Commit Graph
100 Commits
Author SHA1 Message Date
Anton Khirnov 437211ae73 h264: set ref_count to 0 for intra slices.
CC:libav-stable@libav.org
2013-03-02 10:27:13 +01:00
Anton Khirnov 668e16a0dd h264: on reference overflow, reset the reference count to 0, not 1.
Since decode_slice_header() returns before the reference lists are
constructed, there are zero valid references.

CC:libav-stable@libav.org
2013-03-02 10:27:03 +01:00
Anton Khirnov e671d3ad6c h264: do not copy ref count/ref2frm when updating per-frame context
They are filled in decode_slice_header() anyway.
2013-03-02 10:26:50 +01:00
Anton Khirnov d8a74d1d95 qtrle: use AV_LOG_ERROR in an error message. 2013-02-23 13:06:12 +01:00
Anton Khirnov 7b4f91155b qtrle: cosmetics, reformat CHECK_PIXEL_PTR() macro 2013-02-23 13:06:08 +01:00
Anton Khirnov e106592447 qtrle: add more checks against pixel_ptr being negative.
CC:libav-stable@libav.org
2013-02-23 13:05:54 +01:00
Anton Khirnov 4f3b058c84 cavs: initialize various context tables to 0
Avoids crashes with corrupted files.

CC:libav-stable@libav.org
2013-02-23 13:05:43 +01:00
Anton Khirnov 0dff40bfb9 mlpdec: do not try to allocate a zero-sized output buffer.
CC:libav-stable@libav.org
2013-02-23 13:05:31 +01:00
Anton Khirnov 56daf10e03 mov: use the format context for logging.
CC:libav-stable@libav.org
2013-02-23 13:05:16 +01:00
Anton Khirnov ddfe1246d9 flicvideo: avoid an infinite loop in byte run compression
When byte_run is 0, pixel_countdown is not touched and the loop will run
forever.

CC:libav-stable@libav.org
2013-02-23 09:22:30 +01:00
Anton Khirnov 067432c1c9 loco: check that there is data left after decoding a plane.
CC:libav-stable@libav.org
2013-02-23 09:20:42 +01:00
Anton Khirnov de6dfa2bb8 lagarith: avoid infinite loop in lag_rac_refill()
range == 0 happens with corrupted files

CC:libav-stable@libav.org
2013-02-23 09:16:32 +01:00
Anton Khirnov f935aca44c av_memcpy_backptr: avoid an infinite loop for back = 0
CC:libav-stable@libav.org
2013-02-23 09:16:15 +01:00
Anton Khirnov 8097fc9a2d 4xm: check the return value of read_huffman_tables().
CC:libav-stable@libav.org
2013-02-23 09:13:08 +01:00
Anton Khirnov 1f8f43a5b5 error_resilience: add required headers. 2013-02-17 06:46:43 +01:00
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>
2013-02-15 16:35:16 +01:00
Anton Khirnov 1d0feb5d1a mpegvideo: split ff_draw_horiz_band().
Split out dependency on MpegEncContext.
2013-02-15 16:10:19 +01:00
Anton Khirnov 54974c6298 error_resilience: decouple ER from MpegEncContext 2013-02-15 16:10:11 +01:00
Anton Khirnov d9ebb00dcb svq3: remove a pointless if()
The H264 context is always uninitialized at this point.
2013-02-15 16:09:52 +01:00
Anton Khirnov 2491f9ee29 h264: remove a pointless if()
!encoding is always true, we do not have a H.264 encoder
2013-02-15 16:09:45 +01:00
Anton Khirnov 68f930d218 h264: simplify calls to ff_er_add_slice().
partitioned_frame is never set for h264 (as easily seen from git grep).
2013-02-15 16:09:37 +01:00
Anton Khirnov d2a25c4032 get_buffer(): do not initialize the data.
There may be more decoders that rely on this. Those should be found and
fixed.
2013-02-15 16:08:44 +01:00
Anton Khirnov 64ed397635 vf_yadif: fix out-of line reads
Some changes in the border pixels, visually indistinguishable.
2013-02-15 16:08:33 +01:00
Anton Khirnov ccd70d9c16 vf_yadif: factorize initializing the filtering callbacks
Do it all in config_props().
2013-02-15 16:08:00 +01:00
Anton Khirnov 81726a4f0b FATE: add tests for additional flavors of asf cover art 2013-02-09 18:57:21 +01:00
Anton Khirnov 1ef0e8a6bf asfdec: do not assume every AVStream has a corresponding ASFStream
This won't be true for ID3 attached picture.

Also stop allocating now useless dummy ASFStreams for ASF native
attached pictures.
2013-02-09 18:57:21 +01:00
Anton Khirnov 12b54a1f39 mpegvideo: remove an unused function parameter 2013-02-06 21:48:48 +01:00
Anton Khirnov 605b047bcc rv10: improve buffer size check.
Check slice count and input buffer size before constructing a possibly
invalid pointer, not after.
2013-02-06 21:47:57 +01:00
Anton Khirnov c5fcdb4402 error_resilience: remove a useless if() and FIXME
pp_time is never set for h264
2013-02-06 21:46:55 +01:00
Anton Khirnov 9782c778a2 h264: remove silly macros
They serve no useful purpose and wreak all kind of havoc when h264.h is
included elsewhere.
2013-02-06 21:45:02 +01:00
Anton Khirnov ca1fe6c0e6 h263: remove an unused parameter from ff_h263_decode_init_vlc 2013-02-06 21:44:38 +01:00
Anton Khirnov 293065bdb5 mpegvideo: initialize dummy reference frames.
Do not rely on get_buffer initializing them.

Changes yadif tests (off by one in one border pixel), because yadif
reads from those uninitialized lines.
2013-02-06 10:21:52 +01:00
Anton Khirnov dff6197dfb nuv: do not rely on get_buffer() initializing the frame. 2013-02-06 10:21:52 +01:00
Anton Khirnov 8136f23444 yop: check for input overreads.
CC:libav-stable@libav.org
2013-02-06 10:21:52 +01:00
Anton Khirnov 06cf597c35 yop: check that extradata is large enough.
CC:libav-stable@libav.org
2013-02-06 10:21:52 +01:00
Anton Khirnov 2cd4068071 fraps: fix off-by one bug for version 1.
CC:libav-stable@libav.org
2013-02-06 10:21:52 +01:00
Anton Khirnov da7baaaae7 aasc: fix output for msrle compression.
The bottom line was invalid before.

CC:libav-stable@libav.org
2013-02-06 10:21:52 +01:00
Anton Khirnov 238614de67 cdgraphics: do not rely on get_buffer() initializing the frame.
Setting it to zero (instead of 128, as the default get_buffer() does)
also produces more correctly-looking output.
2013-02-06 10:21:52 +01:00
Anton Khirnov 39a9fdd00f yop: initialize palette to 0
The FATE sample contains some pixels with value 0, but the palette
stored in the file contains only values from 16 up. Because the default
and cmdutils get_buffer() initialize the data to 0x80, they appear as
gray dots.
After this commit they change to black dots, which is probably still
incorrect but less visible and doesn't rely on get_buffer() initializing
the data.
2013-02-06 10:21:52 +01:00
Anton Khirnov 9bd6375d5f msrledec: check bounds before constructing a possibly invalid pointer,
CC:libav-stable@libav.org
2013-02-06 10:21:52 +01:00
Anton Khirnov 6ed9fc44ba svq1: replace struct svq1_frame_size with an array.
It is used as an array in svq1enc, so this is more correct.
2013-02-06 10:21:52 +01:00
Anton Khirnov 6a39985451 cmdutils: remove ansi from the list of broken codecs.
It's not relying on get_buffer() initializing the frame since
99e36ddd3e.
2013-02-06 10:21:52 +01:00
Anton Khirnov 99162f8d46 vf_yadif: silence a warning.
clang says:
libavfilter/vf_yadif.c:192:28: warning: incompatible pointer types assigning to
'void (*)(uint8_t *, uint8_t *, uint8_t *, uint8_t *, int, int, int, int, int)'
from 'void (uint16_t *, uint16_t *, uint16_t *, uint16_t *, int, int, int, int, int)'
2013-02-06 10:21:51 +01:00
Anton Khirnov d9df93efbf mpegvideo: simplify REBASE_PICTURE
Always evaluate to NULL when the source Picture is not located in the
MpegEncContext.picture array. That will only happen for
next/last_picture_ptr when updating the thread context during h264 frame
threaded decoding, where they will point to elements of ref_list. Since
ref_list is not copied during updating the context and is invalid until
it is constructed for the current slice, there is no point in doing
anything complicated with next/last_picture_ptr, as they will get
updated when the ref_list is filled.
2013-02-04 06:17:15 +01:00
Anton Khirnov 9ec8971060 bink demuxer: set framerate. 2013-02-01 12:42:17 +01:00
Anton Khirnov 1730ca2eca bink demuxer: check malloc return value 2013-02-01 12:41:38 +01:00
Anton Khirnov f2960097e4 bink: fix a check for the first frame.
Packet pts is a very unreliable indicator, use
AVCodecContext.frame_number instead.
2013-02-01 12:41:31 +01:00
Anton Khirnov 7194330bcd vf_delogo: fix copying the input frame.
CC:libav-stable@libav.org
2013-01-29 07:33:02 +01:00
Anton Khirnov f81c37e40f vf_delogo: fix an uninitialized read.
CC:libav-stable@libav.org
2013-01-29 07:32:54 +01:00
Anton Khirnov 76e74e4831 h264: remove obsolete comment. 2013-01-29 07:32:47 +01:00
Anton Khirnov 47318953dd mpegvideo: remove some unused variables from Picture. 2013-01-29 07:32:36 +01:00
Anton Khirnov 231fd1ed39 utvideoenc/v410enc: do not set AVFrame.reference.
That field will be deprecated.
2013-01-29 07:32:21 +01:00
Anton Khirnov e6b1c3bbe7 pthread: make ff_thread_release_buffer idempotent.
I.e. don't do anything on already released frames.
2013-01-29 07:32:10 +01:00
Anton Khirnov 729b37149c mvi: set framerate
This container does not store timestamps and thus supports CFR only.
2013-01-29 07:31:55 +01:00
Anton Khirnov aec50f79e7 rawdec: use AVPALETTE_SIZE instead of magic constants. 2013-01-29 07:31:43 +01:00
Anton Khirnov e6da5d215b mimic: remove a pointless cast. 2013-01-29 07:31:24 +01:00
Anton Khirnov 30d62507cd mdec: return meaningful error codes. 2013-01-29 07:31:15 +01:00
Anton Khirnov f713411d4c mdec: cosmetics, reformat 2013-01-29 07:27:36 +01:00
Anton Khirnov 098eed95bc mdec: merge mdec_common_init() into decode_init().
There is no point in keeping those two functions separate.
2013-01-29 07:27:23 +01:00
Anton Khirnov f1c395944c eatgv: use fixed-width types where appropriate. 2013-01-29 07:27:08 +01:00
Anton Khirnov 04f4dbc2fa mpegvideo_enc: fix indentation in load_input_picture() 2013-01-26 13:08:38 +01:00
Anton Khirnov 3f47d316cd mpegvideo_enc: do not modify the input frame. 2013-01-26 13:08:32 +01:00
Anton Khirnov 7bcaeb408e mjpegdec: fix indentation 2013-01-26 13:08:07 +01:00
Anton Khirnov 0ce033f888 rawdec: cosmetics, reformat 2013-01-26 13:07:41 +01:00
Anton Khirnov b965cb906b mimic: return meaningful error codes. 2013-01-26 13:06:41 +01:00
Anton Khirnov a0cabd0a27 mimic: cosmetics, reformat 2013-01-26 13:04:15 +01:00
Anton Khirnov 04e1249609 iff: drop ff_ prefix from a static function. 2013-01-26 13:02:33 +01:00
Anton Khirnov 9221c0af77 pngdec: cosmetics, reformat.
Also remove a commented out line.
2013-01-26 13:02:19 +01:00
Anton Khirnov edb2426b75 dxa: return meaningful error codes. 2013-01-26 13:01:14 +01:00
Anton Khirnov adf0110d87 eatgq: cosmetics, reformat. 2013-01-26 13:00:59 +01:00
Anton Khirnov f337c29017 eatgq: return meaningful error codes. 2013-01-26 12:56:39 +01:00
Anton Khirnov 4b7598e2fe eatgv: cosmetics, reformat 2013-01-26 12:56:24 +01:00
Anton Khirnov ade402804a eatgv: return meaningful error codes. 2013-01-26 12:54:35 +01:00
Anton Khirnov 0859eaa012 cyuv: return meaningful error codes. 2013-01-26 12:54:23 +01:00
Anton Khirnov 6837bd6e49 txd: return meaningful error codes. 2013-01-26 12:54:07 +01:00
Anton Khirnov 69c25c9284 dnxhdenc: fix invalid reads in dnxhd_mb_var_thread().
Do not assume that frame dimensions are mod16 (or that height is mod32
for interlaced).

CC:libav-stable@libav.org
2013-01-26 12:30:08 +01:00
Anton Khirnov 940b8b5861 h264: avoid pointless copying of ref lists
ref_list is constructed from other fields per slice when needed, so do
not copy it for both frame and slice threading.
default_ref_list is constructed per frame and still needs to be copied
to per-slice contexts for slice threading, but a copy is not needed for
frame threading.
2013-01-18 07:56:05 +01:00
Anton Khirnov ea382767ad h264: fix ff_generate_sliding_window_mmcos() prototype.
It's been returning an error value since
bad446e251

Also check for the errors it returns.
2013-01-14 21:36:08 +01:00
Anton Khirnov 60a42ef44c truemotion2: cosmetics, reformat 2013-01-14 11:39:57 +01:00
Anton Khirnov df9036830b truemotion2: return meaningful error codes. 2013-01-14 11:39:49 +01:00
Anton Khirnov a4a26f5188 tscc: remove some pointless comments and empty lines. 2013-01-14 11:39:42 +01:00
Anton Khirnov ac1e93f555 tscc: return meaningful error codes. 2013-01-14 11:39:33 +01:00
Anton Khirnov b627c3010b loco: cosmetics, reformat 2013-01-14 11:39:23 +01:00
Anton Khirnov 1a31dff937 loco: return meaningful error codes. 2013-01-14 11:39:15 +01:00
Anton Khirnov a9d970a019 flicvideo: return meaningful error codes. 2013-01-14 11:38:58 +01:00
Anton Khirnov 6b3a1229bb vcr1: remove disabled encoder stub 2013-01-14 11:38:45 +01:00
Anton Khirnov 74a9a624c5 vcr1: return a meaningful error code. 2013-01-14 11:38:38 +01:00
Anton Khirnov e4ca055b3c rpza: return a meaningful error code. 2013-01-14 11:38:31 +01:00
Anton Khirnov 80cf2ebc59 qdrw: cosmetics, reformat 2013-01-14 11:37:55 +01:00
Anton Khirnov 688b132b88 qdrw: return meaningful error codes. 2013-01-14 11:37:43 +01:00
Anton Khirnov 8f17829455 qtrle: return a meaningful error code. 2013-01-14 11:37:31 +01:00
Anton Khirnov 048ffb9bb2 gifdec: return meaningful error codes. 2013-01-14 11:37:17 +01:00
Anton Khirnov 3d973e461b interplayvideo: remove a static variable. 2013-01-14 11:36:45 +01:00
Anton Khirnov 089b3d6815 interplayvideo: return meaningful error codes. 2013-01-14 11:36:33 +01:00
Anton Khirnov 14cf33e957 lcldec: return meaningful error codes. 2013-01-14 11:36:22 +01:00
Anton Khirnov 01cbc6f6ad targa: return meaningful error codes. 2013-01-14 11:36:11 +01:00
Anton Khirnov 62d9655217 qpeg: return a meaningful error code. 2013-01-14 11:35:54 +01:00
Anton Khirnov 3344f5cb74 nuv: return meaningful error codes. 2013-01-14 11:35:17 +01:00
Anton Khirnov a1c525f7eb pcx: return meaningful error codes. 2013-01-14 11:35:04 +01:00
Anton Khirnov 6bf70127d1 tmv: return meaningful error codes. 2013-01-14 11:34:53 +01:00