James Almer
ba625dd8a1
avcodec: use av_mod_uintp2() where useful
...
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
10 years ago
Vittorio Giovara
6a85dfc830
lavc: Replace av_dlog and tprintf with internal macros
10 years ago
Michael Niedermayer
aa6f58dd96
avcodec/h264_refs: More completely clear slice contexts in ff_h264_remove_all_refs()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
429de04320
avcodec/h264_refs: Do not set reference to things which dont exist
...
Fixes deadlock
Fixes Ticket4428
Fixes Ticket4429
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
a38758a97e
avcodec/h264_refs: fix null pointer dereference with -DTRACE
...
Found-by: carl
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Carl Eugen Hoyos
b3673f3414
lavc/h264_refs: Fix compilation with -DTRACE.
10 years ago
Anton Khirnov
a12d3188cb
h264: use a smaller struct for the ref lists
...
There is no need to store a whole H264Picture, with a full AVFrame
embedded in it. This should allow getting rid of the embedded AVFrame
later.
10 years ago
Anton Khirnov
f42485dbce
h264: use a separate GetBitContext for slice data
10 years ago
Anton Khirnov
95eb35f305
h264: move the ref lists variables into the per-slice context
10 years ago
Anton Khirnov
56febc993b
h264: move the slice type variables into the per-slice context
10 years ago
Anton Khirnov
92c6c2a605
h264: split weighted pred-related vars into per-slice context
10 years ago
Michael Niedermayer
ecfd48dc06
avcodec/h264: Move COPY_PICTURE() to h264.h so it can be used from other parts of the h264 decoder
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
e09ad5bd0d
avcodec/h264_refs: set last_pic_for_ec only if it has not been set previously
...
This ensures we do not loose the frame in case or multiple clears
Fixes out of array read
Fixes: asan_heap-oob_2fa47ea_2100_cov_1278768963_ff_add_pixels_clamped_mmx.m2ts
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
855463c007
avcodec/h264: Keep a reference to the last picture for EC
...
This and the next commit improve error concealment for
green-block-artifacts-from-canon-100-hs.MOV
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Gabriel Dume
4b1f5e5090
cosmetics: Write NULL pointer inequality checks more compactly
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
10 years ago
Gabriel Dume
f929ab0569
cosmetics: Write NULL pointer equality checks more compactly
...
Signed-off-by: Diego Biurrun <diego@biurrun.de>
10 years ago
Michael Niedermayer
19c9d1e8e7
avcodec/h264: in the absence of recovery points, be more tolerant on accepting plain I frames
...
Fixes: Ticket3652
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
cba4e6062a
More correct printf format specifiers
...
This avoids compiler warnings about argument and specifier type mismatch.
11 years ago
Vittorio Giovara
e0c16e4e32
mpegvideo: move mpegvideo formats-related defines to mpegutils.h
11 years ago
Vittorio Giovara
9b749c8274
h264: move relevant fields from Picture to H264Picture
11 years ago
Vittorio Giovara
f4bd9fe326
h264: fix clang warning about uninitialized variable
11 years ago
Vittorio Giovara
17a63ff0cd
h264: update flag name in ff_h264_decode_ref_pic_list_reordering()
...
This is the name used in the specifications.
11 years ago
Michael Niedermayer
649686d89b
avcodec/h264_refs: remove lost frames instead of disfavoring them
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
b5005def8a
avcodec/h264: avoid using lost frames as references
...
Fixes Ticket3386
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Luca Barbato
f8c507f44b
h264: Refactor ff_h264_decode_ref_pic_list_reordering
...
In preparation for MVC support.
11 years ago
Anton Khirnov
98cc9efc5f
h264: prevent two matching fields from being both a short/long ref combination
...
Fixes possible access to freed memory.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
11 years ago
Michael Niedermayer
e3d7a3978b
avcodec/h264_refs: improve key frame detection heuristic
...
Fixes Ticket3186
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
ab6ea7a819
avcodec/h264_refs: split conditions of if() up for better readability
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Anton Khirnov
4d388c0cd0
h264_refs: make sure not to write over the bounds of the default ref list
...
Fixes invalid writes.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
11 years ago
Anton Khirnov
a553c6a347
lavc: use buf[0] instead of data[0] in checks whether a frame is allocated
...
data[0] may be NULL for valid frames with hwaccel pixel formats.
11 years ago
Michael Niedermayer
8183e33225
h264_refs: use named constant for setting frame_recovered
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
08a8976196
avcodec/h264: reduce noisiness of "mmco: unref short failure"
...
Do not consider it an error if we have no frames and should discard one.
This condition can easily happen when decoding is started from an I frame
Fixes Ticket2811
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
5ac6b6028f
avcodec/h264_refs: modify key frame detection heuristic to detect more cases
...
Fixes Ticket2968
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
2a61592573
avcodec: Remove some commented-out debug cruft
11 years ago
Michael Niedermayer
c40f51e15b
h264: Always decode MMCOs into temprary array
...
When decoding succeeded the array is copied into the permanent one.
This prevents inconsistencies
Fixes assertion failure
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Diego Biurrun
1b6f84a986
h264_refs: Do not print check_opcodes() return value
...
The return value provides no useful information and removing the printing
avoids the following warning:
libavcodec/h264_refs.c:788:15: warning: 'i' may be used uninitialized in this function [-Wuninitialized]
12 years ago
Michael Niedermayer
34ea5f418e
h264_refs: check for multiple mismatching long term ref assignments
...
Fixes failure of the assert added a few hours ago.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
3f2ce24f59
h264_refs: assert that the references are not deallocated
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
fbb6741a84
h264_refs: assert that long ref fields have not been inserted multiple times
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
92002db3eb
h264_refs: Check for attempts to assign pictures to short & long.
...
Fixes null pointer dereference
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
7fa00653a5
h264: add a parameter to the FIELD_PICTURE macro.
...
This way it does not look like a constant.
12 years ago
Michael Niedermayer
fa7031ad37
h264_refs: fix typo in refs fallback check
...
Fixes regression since 01a0283
Fixes Ticket2371
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
01a0283c92
h264: disallow single unpaired fields as references of frames
...
Fixes deadlock
12 years ago
Anton Khirnov
c2597c5a0a
h264_refs: cosmetics, reformat
12 years ago
Anton Khirnov
759001c534
lavc decoders: work with refcounted frames.
12 years ago
Diego Biurrun
c242bbd8b6
Remove unnecessary dsputil.h #includes
12 years ago
Anton Khirnov
2c54155407
h264: deMpegEncContextize
...
Most of the changes are just trivial are just trivial replacements of
fields from MpegEncContext with equivalent fields in H264Context.
Everything in h264* other than h264.c are those trivial changes.
The nontrivial parts are:
1) extracting a simplified version of the frame management code from
mpegvideo.c. We don't need last/next_picture anymore, since h264 uses
its own more complex system already and those were set only to appease
the mpegvideo parts.
2) some tables that need to be allocated/freed in appropriate places.
3) hwaccels -- mostly trivial replacements.
for dxva, the draw_horiz_band() call is moved from
ff_dxva2_common_end_frame() to per-codec end_frame() callbacks,
because it's now different for h264 and MpegEncContext-based
decoders.
4) svq3 -- it does not use h264 complex reference system, so I just
added some very simplistic frame management instead and dropped the
use of ff_h264_frame_start(). Because of this I also had to move some
initialization code to svq3.
Additional fixes for chroma format and bit depth changes by
Janne Grunau <janne-libav@jannau.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
12 years ago
Michael Niedermayer
c230af9bcc
h264: Reset last_pocs in case of reference or frame number inconsistencies
...
This prevents faulty increasing of has_b_frames
Should fix Ticket 2062
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
3fba3e79a3
h264/ff_generate_sliding_window_mmcos: fix use of uninitialized variable
...
Fixes CID968587
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
dcbe15813e
h264: print mismatching opcode details in check_opcodes()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago