]> git.sesse.net Git - ffmpeg/commitdiff
Merge remote-tracking branch 'cehoyos/master'
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 10 Mar 2014 23:53:20 +0000 (00:53 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 10 Mar 2014 23:53:24 +0000 (00:53 +0100)
* cehoyos/master:
  Define ff_log2_run[] in libavcodec/internal.h.
  Replace an incorrect av_free() in movenc.c with av_freep().

Merged-by: Michael Niedermayer <michaelni@gmx.at>
configure
libavcodec/golomb.h
libavformat/hevc.c
libavformat/hevc.h

index 3c21cb93282a9aba082933b6428b60ef7f00db4b..92f6d22ca3203637f454e30b184fbeadedaa71bd 100755 (executable)
--- a/configure
+++ b/configure
@@ -1399,6 +1399,7 @@ CONFIG_LIST="
     network
     nonfree
     pic
+    pod2man
     raise_major
     rdft
     runtime_cpudetect
@@ -1413,19 +1414,19 @@ CONFIG_LIST="
     xmm_clobber_test
 "
 
-THREADS_LIST='
+THREADS_LIST="
     pthreads
-    w32threads
     os2threads
-'
+    w32threads
+"
 
-ATOMICS_LIST='
+ATOMICS_LIST="
     atomics_gcc
     atomics_suncc
     atomics_win32
-'
+"
 
-ARCH_LIST='
+ARCH_LIST="
     aarch64
     alpha
     arm
@@ -1450,18 +1451,18 @@ ARCH_LIST='
     x86
     x86_32
     x86_64
-'
+"
 
-ARCH_EXT_LIST_ARM='
+ARCH_EXT_LIST_ARM="
     armv5te
     armv6
     armv6t2
     neon
     vfp
     vfpv3
-'
+"
 
-ARCH_EXT_LIST_X86_SIMD='
+ARCH_EXT_LIST_X86_SIMD="
     amd3dnow
     amd3dnowext
     avx
@@ -1477,7 +1478,7 @@ ARCH_EXT_LIST_X86_SIMD='
     sse42
     ssse3
     xop
-'
+"
 
 ARCH_EXT_LIST_X86="
     $ARCH_EXT_LIST_X86_SIMD
@@ -1497,18 +1498,18 @@ ARCH_EXT_LIST="
     mipsdspr2
 "
 
-HAVE_LIST_CMDLINE='
+HAVE_LIST_CMDLINE="
     inline_asm
     symver
     yasm
-'
+"
 
-HAVE_LIST_PUB='
+HAVE_LIST_PUB="
     bigendian
     fast_unaligned
     incompatible_libav_abi
     incompatible_fork_abi
-'
+"
 
 MATH_FUNCS="
     atanf
@@ -1542,11 +1543,11 @@ HAVE_LIST="
     $ARCH_EXT_LIST
     $(add_suffix _external $ARCH_EXT_LIST)
     $(add_suffix _inline   $ARCH_EXT_LIST)
+    $ATOMICS_LIST
     $HAVE_LIST_CMDLINE
     $HAVE_LIST_PUB
-    $THREADS_LIST
-    $ATOMICS_LIST
     $MATH_FUNCS
+    $THREADS_LIST
     access
     aligned_malloc
     aligned_stack
@@ -1592,9 +1593,9 @@ HAVE_LIST="
     GetProcessAffinityMask
     GetProcessMemoryInfo
     GetProcessTimes
-    GetSystemTimeAsFileTime
     getrusage
     getservbyport
+    GetSystemTimeAsFileTime
     gettimeofday
     glob
     glXGetProcAddress
@@ -1603,8 +1604,8 @@ HAVE_LIST="
     gsm_h
     ibm_asm
     inet_aton
-    io_h
     inline_asm_labels
+    io_h
     isatty
     jack_port_get_latency_range
     kbhit
@@ -1669,8 +1670,6 @@ HAVE_LIST="
     symver_asm_label
     symver_gnu_asm
     sync_val_compare_and_swap
-    sysconf
-    sysctl
     sys_mman_h
     sys_param_h
     sys_resource_h
@@ -1679,6 +1678,8 @@ HAVE_LIST="
     sys_time_h
     sys_un_h
     sys_videoio_h
+    sysconf
+    sysctl
     termios_h
     texi2html
     threads
@@ -1748,7 +1749,7 @@ CMDLINE_SELECT="
     stripping
 "
 
-PATHS_LIST='
+PATHS_LIST="
     bindir
     datadir
     docdir
@@ -1757,7 +1758,7 @@ PATHS_LIST='
     mandir
     prefix
     shlibdir
-'
+"
 
 CMDLINE_SET="
     $PATHS_LIST
@@ -1981,8 +1982,8 @@ mdec_decoder_select="dsputil error_resilience mpegvideo"
 metasound_decoder_select="lsp mdct sinewin"
 mimic_decoder_select="dsputil hpeldsp"
 mjpeg_decoder_select="dsputil hpeldsp exif"
-mjpegb_decoder_select="mjpeg_decoder"
 mjpeg_encoder_select="aandcttables dsputil mpegvideoenc"
+mjpegb_decoder_select="mjpeg_decoder"
 mlp_decoder_select="dsputil mlp_parser"
 motionpixels_decoder_select="dsputil"
 mp1_decoder_select="mpegaudio"
@@ -2044,9 +2045,9 @@ svq3_decoder_select="h264_decoder hpeldsp mpegvideo"
 svq3_decoder_suggest="zlib"
 tak_decoder_select="dsputil"
 theora_decoder_select="vp3_decoder"
+thp_decoder_select="mjpeg_decoder"
 tiff_decoder_suggest="zlib"
 tiff_encoder_suggest="zlib"
-thp_decoder_select="mjpeg_decoder"
 truehd_decoder_select="mlp_parser"
 truemotion2_decoder_select="dsputil"
 truespeech_decoder_select="dsputil"
@@ -2328,8 +2329,8 @@ ffrtmphttp_protocol_deps="!librtmp_protocol"
 ffrtmphttp_protocol_select="http_protocol"
 ftp_protocol_select="tcp_protocol"
 gopher_protocol_select="network"
-httpproxy_protocol_select="tcp_protocol"
 http_protocol_select="tcp_protocol"
+httpproxy_protocol_select="tcp_protocol"
 https_protocol_select="tls_protocol"
 librtmp_protocol_deps="librtmp"
 librtmpe_protocol_deps="librtmp"
@@ -2396,7 +2397,6 @@ mpdecimate_filter_deps="gpl avcodec"
 mptestsrc_filter_deps="gpl"
 negate_filter_deps="lut_filter"
 perspective_filter_deps="gpl"
-resample_filter_deps="avresample"
 ocv_filter_deps="libopencv"
 owdenoise_filter_deps="gpl"
 pan_filter_deps="swresample"
@@ -2404,6 +2404,7 @@ phase_filter_deps="gpl"
 pp_filter_deps="gpl postproc"
 pullup_filter_deps="gpl"
 removelogo_filter_deps="avcodec avformat swscale"
+resample_filter_deps="avresample"
 sab_filter_deps="gpl swscale"
 scale_filter_deps="swscale"
 smartblur_filter_deps="gpl swscale"
@@ -2843,7 +2844,7 @@ case "$toolchain" in
         add_ldflags -fprofile-arcs -ftest-coverage
     ;;
     hardened)
-        add_cflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all
+        add_cflags  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all
         add_ldflags -Wl,-z,relro -Wl,-z,now
     ;;
     ?*)
index 43875dc85c4387f88c38b470b4c62a82efc8bb4c..22c2d64030348b0d706a844efd9015ff2a31c224 100644 (file)
@@ -214,6 +214,18 @@ static inline int get_se_golomb(GetBitContext *gb)
     }
 }
 
+static inline int get_se_golomb_long(GetBitContext *gb)
+{
+    unsigned int buf = get_ue_golomb_long(gb);
+
+    if (buf & 1)
+        buf = -(buf >> 1);
+    else
+        buf = (buf >> 1);
+
+    return buf;
+}
+
 static inline int svq3_get_se_golomb(GetBitContext *gb)
 {
     unsigned int buf;
index 19dd2f40cfddb4b2d8c5c01e9fbfbab261e89fc1..96323861532a10d0f7d1c1a2c787824281ba1add 100644 (file)
@@ -402,10 +402,10 @@ static void skip_scaling_list_data(GetBitContext *gb)
                 num_coeffs = FFMIN(64, 1 << (4 + (i << 1)));
 
                 if (i > 1)
-                    get_se_golomb(gb); // scaling_list_dc_coef_minus8[i-2][j]
+                    get_se_golomb_long(gb); // scaling_list_dc_coef_minus8[i-2][j]
 
                 for (k = 0; k < num_coeffs; k++)
-                    get_se_golomb(gb); // scaling_list_delta_coef
+                    get_se_golomb_long(gb); // scaling_list_delta_coef
             }
 }
 
@@ -593,7 +593,7 @@ static int hvcc_parse_pps(GetBitContext *gb,
 
     get_ue_golomb_long(gb); // num_ref_idx_l0_default_active_minus1
     get_ue_golomb_long(gb); // num_ref_idx_l1_default_active_minus1
-    get_se_golomb     (gb); // init_qp_minus26
+    get_se_golomb_long(gb); // init_qp_minus26
 
     /*
      * constrained_intra_pred_flag u(1)
@@ -604,8 +604,8 @@ static int hvcc_parse_pps(GetBitContext *gb,
     if (get_bits1(gb))          // cu_qp_delta_enabled_flag
         get_ue_golomb_long(gb); // diff_cu_qp_delta_depth
 
-    get_se_golomb(gb); // pps_cb_qp_offset
-    get_se_golomb(gb); // pps_cr_qp_offset
+    get_se_golomb_long(gb); // pps_cb_qp_offset
+    get_se_golomb_long(gb); // pps_cr_qp_offset
 
     /*
      * weighted_pred_flag               u(1)
@@ -1066,52 +1066,15 @@ int ff_hevc_annexb2mp4_buf(const uint8_t *buf_in, uint8_t **buf_out,
                            int *size, int filter_ps, int *ps_count)
 {
     AVIOContext *pb;
-    int num_ps = 0, ret = 0;
-    uint8_t *buf, *end, *start = NULL;
-
-    if (!filter_ps) {
-        ret = ff_avc_parse_nal_units_buf(buf_in, buf_out, size);
-        goto end;
-    }
+    int ret;
 
     ret = avio_open_dyn_buf(&pb);
     if (ret < 0)
-        goto end;
-
-    ret = ff_avc_parse_nal_units_buf(buf_in, &start, size);
-    if (ret < 0)
-        goto end;
-
-    buf = start;
-    end = start + *size;
-
-    while (end - buf > 4) {
-        uint32_t len = FFMIN(AV_RB32(buf), end - buf - 4);
-        uint8_t type = (buf[4] >> 1) & 0x3f;
-
-        buf += 4;
-
-        switch (type) {
-        case NAL_VPS:
-        case NAL_SPS:
-        case NAL_PPS:
-            num_ps++;
-            break;
-        default:
-            avio_wb32(pb, len);
-            avio_write(pb, buf, len);
-            break;
-        }
-
-        buf += len;
-    }
+        return ret;
 
+    ret   = ff_hevc_annexb2mp4(pb, buf_in, *size, filter_ps, ps_count);
     *size = avio_close_dyn_buf(pb, buf_out);
 
-end:
-    av_free(start);
-    if (ps_count)
-        *ps_count = num_ps;
     return ret;
 }
 
index c687f1b1fc93b8aa72d6b65ae8b468c00f5873a1..796eaf40b160c435de992e4426881b47c20a4dba 100644 (file)
@@ -71,8 +71,8 @@ int ff_hevc_annexb2mp4(AVIOContext *pb, const uint8_t *buf_in,
  *        or to discard them (non-zero)
  * @param ps_count address of the variable where the number of discarded
  *        parameter set NAL units shall be written, may be NULL
- * @return >=0 in case of success, a negative value corresponding to an AVERROR
- *         code in case of failure
+ * @return the amount (in bytes) of data written in case of success, a negative
+ *         value corresponding to an AVERROR code in case of failure
  */
 int ff_hevc_annexb2mp4_buf(const uint8_t *buf_in, uint8_t **buf_out,
                            int *size, int filter_ps, int *ps_count);