Commit Graph

416 Commits

Author SHA1 Message Date
Michael Niedermayer
c43ebd94e4 Merge commit '33259118155764ce27a3433894659dda1d148b5f'
* commit '33259118155764ce27a3433894659dda1d148b5f':
  h263: improve hwaccel #ifdefs

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-31 21:50:24 +02:00
Rémi Denis-Courmont
3325911815 h263: improve hwaccel #ifdefs 2014-03-31 17:52:38 +02:00
Michael Niedermayer
ec6d043f8e avcodec/h263dec: Workaround H263 end padding bug
Fixes: H263PaddingBugFixVID_6647.MOV

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-04 02:47:12 +01:00
Michael Niedermayer
ec5499d8ba Merge commit 'e2ceb17642f374a7df8f1f5d3d2b2446525bc7fb'
* commit 'e2ceb17642f374a7df8f1f5d3d2b2446525bc7fb':
  mpeg4videodec: move mpeg4-specific post-frame-decode code from h264dec to mpeg4videodec

Conflicts:
	libavcodec/h263dec.c
	libavcodec/mpeg4video.h
	libavcodec/mpeg4videodec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-30 02:42:56 +01:00
Michael Niedermayer
b239f3f69d avcodec/h263dec: move call to ff_mpeg4_workaround_bugs() under codec_id check
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-30 02:35:13 +01:00
Michael Niedermayer
6c9b82b6a0 avcodec/mpeg4videodec: move bug workaround code into seperate function
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-30 02:12:11 +01:00
Michael Niedermayer
f5d6541ba0 Merge commit 'ad09f52586eae4c5473c3a6a803d73e1ba56c0eb'
* commit 'ad09f52586eae4c5473c3a6a803d73e1ba56c0eb':
  h263dec: remove commented out cruft

Conflicts:
	libavcodec/h263dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-29 23:46:30 +01:00
Michael Niedermayer
68c90fc086 Merge commit '1a89025793ca73d9685a8ce8e3194efa64dd6844'
* commit '1a89025793ca73d9685a8ce8e3194efa64dd6844':
  mpeg4videodec: move MpegEncContext.vol_sprite_usage to Mpeg4DecContext

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-29 23:04:26 +01:00
Michael Niedermayer
ad13b8ca9b Merge commit 'ee8af2dd99dcb7a01a667deedec81d1aa2a00d72'
* commit 'ee8af2dd99dcb7a01a667deedec81d1aa2a00d72':
  mpeg4videodec: move MpegEncContext.shape to Mpeg4DecContext

Conflicts:
	libavcodec/h263dec.c
	libavcodec/mpeg4videodec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-29 22:35:52 +01:00
Anton Khirnov
e2ceb17642 mpeg4videodec: move mpeg4-specific post-frame-decode code from h264dec to mpeg4videodec 2013-11-29 14:19:47 +01:00
Anton Khirnov
ad09f52586 h263dec: remove commented out cruft 2013-11-29 14:19:47 +01:00
Anton Khirnov
1a89025793 mpeg4videodec: move MpegEncContext.vol_sprite_usage to Mpeg4DecContext 2013-11-29 14:19:47 +01:00
Anton Khirnov
ee8af2dd99 mpeg4videodec: move MpegEncContext.shape to Mpeg4DecContext 2013-11-29 14:19:47 +01:00
Anton Khirnov
b452d5ae86 mpeg4videodec: move mpeg4-specific bug detection from h263 generic code to mpeg4 2013-11-29 14:19:47 +01:00
Michael Niedermayer
03beb5792a Merge remote-tracking branch 'qatar/master'
* qatar/master:
  h263dec: sanitize a condition.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-28 11:21:52 +01:00
Anton Khirnov
8733799392 h263dec: sanitize a condition.
Call ff_mpeg4_decode_picture_header() only when the decoder has the
MPEG4 codec id, not based on a vaguely related value of h263_pred.
2013-11-27 22:24:50 +01:00
Michael Niedermayer
78e150c5e9 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  hwaccel: Simplify ff_find_hwaccel

Conflicts:
	libavcodec/mpeg12dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-10 17:37:51 +01:00
Luca Barbato
08303d7741 hwaccel: Simplify ff_find_hwaccel
It is always called by passing fields from an AVCodecContext.
2013-11-10 13:59:48 +01:00
Michael Niedermayer
a30f7918b5 Merge commit '0338c396987c82b41d322630ea9712fe5f9561d6'
* commit '0338c396987c82b41d322630ea9712fe5f9561d6':
  dsputil: Split off H.263 bits into their own H263DSPContext

Conflicts:
	configure
	libavcodec/mpegvideo.h
	libavcodec/mpegvideo_enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-08 17:42:56 +01:00
Diego Biurrun
0338c39698 dsputil: Split off H.263 bits into their own H263DSPContext 2013-11-08 12:40:47 +01:00
Michael Niedermayer
e6b9d71ad9 Merge commit '3b086317277e3f3b61c0343930d8e2570b278bd6'
* commit '3b086317277e3f3b61c0343930d8e2570b278bd6':
  h26[13]dec: stop using deprecated avcodec_set_dimensions
  gifdec: stop using deprecated avcodec_set_dimensions
  g2meet: stop using deprecated avcodec_set_dimensions

Conflicts:
	libavcodec/gifdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-01 14:54:40 +01:00
Anton Khirnov
3b08631727 h26[13]dec: stop using deprecated avcodec_set_dimensions 2013-10-31 20:14:15 +01:00
Michael Niedermayer
c00686518c avcodec/h263dec: fix handling of AV_EF_EXPLODE
This fixes checking a variable that had been overwritten before.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 17:05:59 +01:00
Michael Niedermayer
a66ee3dc87 Merge commit 'aaaf2dc023d31f30eeec874f24b50f44b9295185'
* commit 'aaaf2dc023d31f30eeec874f24b50f44b9295185':
  h263: Check init_get_bits return value

Conflicts:
	libavcodec/h263dec.c

See: d47e14b53a
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 12:09:12 +01:00
Michael Niedermayer
d57a6fe6ab Merge commit '0749314886390f6ec81d45e0ba424fcb36c945cf'
* commit '0749314886390f6ec81d45e0ba424fcb36c945cf':
  h263: Return meaningful errors

Conflicts:
	libavcodec/h263dec.c

See: 7b62d3415e
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 11:54:46 +01:00
Michael Niedermayer
aaaf2dc023 h263: Check init_get_bits return value
And use init_get_bits8 to check for integer overflows while at it.

CC: libav-stable@libav.org
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-10-28 00:04:49 +01:00
Luca Barbato
0749314886 h263: Return meaningful errors 2013-10-28 00:04:49 +01:00
Michael Niedermayer
4c18c31438 Merge commit '1ce3ec24b35d9d549b12f17bd7fd391abaf3a6f7'
* commit '1ce3ec24b35d9d549b12f17bd7fd391abaf3a6f7':
  h263: K&R formatting cosmetics

Conflicts:
	libavcodec/h263dec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-23 19:37:09 +02:00
Luca Barbato
1ce3ec24b3 h263: K&R formatting cosmetics
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2013-10-23 13:17:23 +02:00
Michael Niedermayer
d47e14b53a h263dec: use init_get_bits8() and check its return code
Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-21 23:37:49 +02:00
Michael Niedermayer
ee77140afa Merge commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2'
* commit 'b2bed9325dbd6be0da1d91ffed3f513c40274fd2':
  cosmetics: Group .name and .long_name together in codec/format declarations

Conflicts:
	libavcodec/8svx.c
	libavcodec/alac.c
	libavcodec/cljr.c
	libavcodec/dnxhddec.c
	libavcodec/dnxhdenc.c
	libavcodec/dpxenc.c
	libavcodec/dvdec.c
	libavcodec/dvdsubdec.c
	libavcodec/dvdsubenc.c
	libavcodec/ffv1dec.c
	libavcodec/flacdec.c
	libavcodec/flvdec.c
	libavcodec/fraps.c
	libavcodec/frwu.c
	libavcodec/g726.c
	libavcodec/gif.c
	libavcodec/gifdec.c
	libavcodec/h261dec.c
	libavcodec/h263dec.c
	libavcodec/iff.c
	libavcodec/imc.c
	libavcodec/libopencore-amr.c
	libavcodec/libopenjpegdec.c
	libavcodec/libopenjpegenc.c
	libavcodec/libspeexenc.c
	libavcodec/libvo-amrwbenc.c
	libavcodec/libvorbisenc.c
	libavcodec/libvpxenc.c
	libavcodec/libx264.c
	libavcodec/libxavs.c
	libavcodec/libxvid.c
	libavcodec/ljpegenc.c
	libavcodec/mjpegbdec.c
	libavcodec/mjpegdec.c
	libavcodec/mpeg12dec.c
	libavcodec/mpeg4videodec.c
	libavcodec/msmpeg4dec.c
	libavcodec/pgssubdec.c
	libavcodec/pngdec.c
	libavcodec/pngenc.c
	libavcodec/proresdec_lgpl.c
	libavcodec/proresenc_kostya.c
	libavcodec/ra144enc.c
	libavcodec/rawdec.c
	libavcodec/rv10.c
	libavcodec/sp5xdec.c
	libavcodec/takdec.c
	libavcodec/tta.c
	libavcodec/v210dec.c
	libavcodec/vp6.c
	libavcodec/wavpack.c
	libavcodec/xbmenc.c
	libavcodec/yop.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-04 12:34:23 +02:00
Diego Biurrun
b2bed9325d cosmetics: Group .name and .long_name together in codec/format declarations 2013-10-03 23:32:01 +02:00
Michael Niedermayer
17513f4fb3 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  h263dec: Remove a hack that can cause infinite loops

Conflicts:
	libavcodec/h263dec.c

See: d2981b8ef1
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-24 10:59:22 +02:00
Martin Storsjö
8812a8057f h263dec: Remove a hack that can cause infinite loops
The actual usefulness of the hack is not known, and it does cause
infinite loops with some broken input files.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-09-23 23:14:49 +03:00
Reimar Döffinger
2aa8e33d7d Fix nonsense MPEG-4 hwaccel code.
Issues with the code:
1) The skip_bits_long breaks packed B-frames since we skip
of the packed frame, even for VDPAU.
2) Calling ff_h263_find_resync_marker_reverse is nonsense for MPEG-4,
and for H.263 the only code using this (vaapi_mpeg4) explicitly reverts
this change!
3) mb_x/mb_y are always 0 when vaapi_mpeg4_decode_slice, so doing
computations with them is just obfuscation
4) due to not updating mb_y the code would always go into the error
resilience case, causing nonsense error messages and maybe further
issues.

While tested to fix the data provided to the decoder in case of
VDPAU so it is the same as for the non-hwaccel code, the VA-API code
was not tested to still work, and adding regression testing even
as a quick hack is much more complicated for it.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2013-09-22 16:08:35 +02:00
Reimar Döffinger
f76b633a94 mpeg4dec: Ensure data is not clobbered too early.
Avoid overwriting the bitstream buffer data before we
have ended processing the frame.
This is necessary to fix hwaccels which might try to use
the buffer during the end_frame call.
I am not sure but it is possible this could even trigger
a use-after-free if the av_fast_malloc allocated a new buffer.
This would require that decode_slice did not wind the bitstream
forward all the way to the end, which does not currently happen in
normal streams.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2013-09-21 09:40:28 +02:00
Michael Niedermayer
7495186fd4 avcodec/h263dec: fix aspect of lead h263 EHC
Fixes part of ticket925

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-24 18:59:58 +02:00
Michael Niedermayer
b99d3613cf avcodec/h263dec: use FF_CEIL_RSHIFT()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-24 04:09:43 +02:00
Michael Niedermayer
5cc8b81687 mpeg4videodec: fix GEOV/GEOX fliping
Fixes Ticket317
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-24 01:04:23 +02:00
Michael Niedermayer
a0c6c8e53e Revert "Merge commit of 'vdpau: remove old-style decoders'"
This reverts commit bf36dc50ea, reversing
changes made to b7fc2693c7.

Conflicts:

	libavcodec/h264.c

Keeping support for the old VDPAU API has been requested by our VDPAU maintainer

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-17 22:17:49 +02:00
Michael Niedermayer
bf36dc50ea Merge commit '578ea75a9e4ac56e0bbbbe668700be756aa699f8'
* commit '578ea75a9e4ac56e0bbbbe668700be756aa699f8':
  vdpau: remove old-style decoders

Conflicts:
	libavcodec/allcodecs.c
	libavcodec/h263dec.c
	libavcodec/h264.c
	libavcodec/mpeg12dec.c
	libavcodec/mpeg4videodec.c
	libavcodec/vc1dec.c
	libavcodec/vdpau.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-06 13:24:22 +02:00
Rémi Denis-Courmont
578ea75a9e vdpau: remove old-style decoders
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-08-05 11:15:49 +02:00
Michael Niedermayer
efc08e00cc Merge commit 'b3ea76624ad1baab0b6bcc13f3f856be2f958110'
* commit 'b3ea76624ad1baab0b6bcc13f3f856be2f958110':
  vf_aspect: use the name 's' for the pointer to the private context
  Remove commented-out debug #define cruft

Conflicts:
	libavcodec/4xm.c
	libavcodec/dvdsubdec.c
	libavcodec/ituh263dec.c
	libavcodec/mpeg12.c
	libavfilter/avfilter.c
	libavfilter/vf_aspect.c
	libavfilter/vf_fieldorder.c
	libavformat/rtmpproto.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-16 09:56:43 +02:00
Michael Niedermayer
4390fa6273 Merge commit 'd46c588f3cb1963a00e990ceaf4ba9ffa05a716d'
* commit 'd46c588f3cb1963a00e990ceaf4ba9ffa05a716d':
  Remove commented-out #includes
  h263dec: Remove broken and disabled debug cruft
  vc1: Reindent INIT_LUT(), align backslashes

Conflicts:
	libavcodec/vc1.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-16 09:11:04 +02:00
Diego Biurrun
2832ea26f3 Remove commented-out debug #define cruft 2013-05-16 00:23:30 +02:00
Diego Biurrun
bfd00cc4c2 h263dec: Remove broken and disabled debug cruft 2013-05-15 23:01:21 +02:00
Reimar Döffinger
a39cd8766f Fix multithreaded MPEG-4 decoding.
Regression since c10d498bfd.
Unfortunately ff_thread_get_format can only be called from
a separate decode thread, running it during init will fail.
Fixes for that are welcome, for now just revert back to
calling avctx->get_format directly, which is correct
but having to decide on a case-by-case basis which approach
to use is a bit messy.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2013-04-19 01:26:54 +02:00
Reimar Döffinger
c10d498bfd Add thread-safe wrapper for get_format().
Just like get_buffer, get_format should not be called from a different
thread if thread_safe_callbacks is not set.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2013-04-15 09:04:07 +02:00
Michael Niedermayer
ace0cfea60 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  hwaccel: fix use with frame based multithreading

Conflicts:
	libavcodec/h263dec.c
	libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-03-27 11:51:33 +01:00
Janne Grunau
05fa79b844 hwaccel: fix use with frame based multithreading
Allows use of AVHWAccel based decoders with frame based multithreading.
The decoders will be forced into an non-concurrent mode by delaying
ff_thread_finish_setup() calls after decoding of the current frame
is finished.

This wastes memory by unnecessarily using multiple threads and thus
copies of the decoder context but allows seamless switching between
hardware accelerated and frame threaded software decoding when the
hardware decoder does not support the stream.
2013-03-26 19:44:50 +01:00