This also fixes intra-only MT failures (it was the same bug), see trac
4526 and 4527.
Tested-by: James Almer <jamrial@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Check extended sync word for 16-bit LE and BE core streams to reduce
probability of alias sync detection. Previously sync word extension was
checked only for 14-bit streams (and this check did not properly work
across buffer boundary).
Use 64-bit parser state to make extended sync word detection work across
buffer boundary.
This is sufficient to make the sample in ticket #4492 parse
successfully.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit '7a4f74eed51f914e9bbfebaffd4a92ac6791f819':
h264: embed the DPB in the context
Conflicts:
libavcodec/h264.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '88c612e3a4d5b584e2d9f6e2541de78d67bdfb9f':
h264: merge the init and reinit paths in update_thread_context()
Conflicts:
libavcodec/h264_slice.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '8a66fd40260b7aae6226d68c4dbad43b05a8e524':
h264: drop the reinit parameter from init_slice_header()
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'c9ccbc7333eddd025ebbde5cc4f27d68a950c623':
h264: update the current bit depth/chroma type in init_slice_header()
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '440e8dd374b732c48d564d9f1bb0ec3b1b786fb9':
h264: drop a comment that carries no useful information
Merged-by: Michael Niedermayer <michaelni@gmx.at>
It does not make sense to copy is_avc without copying this as well. This
patch should not change anything for now, but will have an effect in
later commits.
That function currently does two things -- reinitializing the DSP
contexts and setting low_delay based on the SPS values.
The former more appropriately belongs in h264_slice_header_init(), while
the latter only really makes sense in decode_slice_header().
The third call to ff_h264_set_parameter_from_sps(), done immediately
after parsing a new SPS, appears to serve no useful purpose, so it is
just dropped.
Also, drop now unneeded H264Context.cur_chroma_format_idc.
Currently, the DPB is initialized in alloc_tables() and uninitialized in
free_tables(), but those functions manage frame size-dependent
variables, so DPB management does not logically belong in there.
Since we want the init/uninit to happen exactly once per the context
lifetime, init_context()/free_context() are the proper place for this
code.
* commit '0c69164f451cc9ca6ce9d6e7568083e2776bc845':
h263: Convert function to macro
Conflicts:
libavcodec/h263.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '59dfc2b0c89f35c5805abee72c2ae4ee7af8e98d':
h263: Drop commented-out code and a related otherwise unused function
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'c3418201307c6b7a2b3e3be10f33ab4a20a32c3b':
jpeglsenc: Mark codec as init-thread-safe and init-cleanup
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'f5ba67ee1342b7741200ff637fc3ea3387b68a1b':
flacenc: Move a scratch buffer to struct used by the function
Conflicts:
libavcodec/flacenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
s->decoded_buffer is allocated with a min_size of:
2 * FFALIGN(blockstodecode, 8) * sizeof(*s->decoded_buffer)
Then it is assigned to s->decoded[0] (and s->decoded_buffer + FFALIGN(blockstodecode, 8)
to s->decoded[1]) and passed as out buffer to decode_array_0000.
In this function 64 elements of the out buffer are written
unconditionally and outside the array if blockstodecode is too small.
This causes memory corruption, leading to segmentation faults or other
crashes.
Thus change decode_array_0000 to write at most blockstodecode elements
of the out buffer.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Otherwise range_start_decoding is not necessarily run and thus
ctx->rc.range still 0 in range_dec_normalize leading to an infinite
loop.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
GCC tool had a bug of PPC intrinsic interpret, which has been fixed in GCC 4.9.1. This bug lead to
errors in two of our previous patches. We found this when we update our GCC tools to 4.9.1 and by
reading the related info on GCC website. We fix our previous error in two separate commits
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
HAVE_LOONGSON is replaced by HAVE_LOONGSON3. Even Loongson-2E and 2F support
Loongson SIMD instructs but have low performance for decoding. We plan to focus
on optimizing Loongson-3A1000, 3B1500 and 3A1500, and modify the configure file
to support Loongson-2 series later by adding HAVE_LOONGSON2.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Niklesh <niklesh.lalwani@iitb.ac.in>
Previous version reviewed-by: Philip Langdale <philipl@overt.org>
Previous version reviewed-by: Carl Eugen Hoyos <cehoyos@ag.or.at>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit '18db1286b04557aa2d2df7efbcb65ae825d5a469':
libxvid: Make codec use the init-cleanup flag and mark it as init-thread-safe
Conflicts:
libavcodec/libxvid.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'eae7338e1592f4a398b7c3cb9d1ac854b7a44ff8':
libx264: Make codec use the init-cleanup flag and mark it as init-thread-safe
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '74a1cad7e3ba79e5b1e5b2e2bcf6179520442679':
lclenc: Mark codec as init-thread-safe and init-cleanup
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'bb428e00ac158244d6691bf135be404e85b66a8b':
hqx: Mark codec as init-thread-safe and init-cleanup
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '43171886e08b6a2f20a1e2f3ecc95a7984b591cd':
huffyuvenc: Mark codec as init-thread-safe and init-cleanup
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'd90133b77bf69667d10e54de9aae7da223c6876a':
asvenc: Mark codec as init-thread-safe and init-cleanup
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '5bba3ab0cf7a0238ee1ea31ca2da08ce860fd8f9':
internal: Make dlog/tlog a no-op when disabled
Conflicts:
libavcodec/internal.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
The unaligned size is not handled in setctx_2d(), causing edges of images
to have improper segmentation prediction, which causes visual artifacts
at image edges a few frames later.
this quiets a warning:
Failed to set VP8E_SET_NOISE_SENSITIVITY codec control: Unspecified
internal error
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Zern <jzern@google.com>
If rice_limit is 0, k can be 0 in decode_scalar, which calls show_bits(gb, k).
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit '0a51c7d42a519c63178a4f3e35b8967f21da3a6a':
prores: Set the bits_per_coded_sample for alpha pix_fmt
Merged-by: Michael Niedermayer <michaelni@gmx.at>