Commit Graph

53 Commits

Author SHA1 Message Date
Michael Niedermayer
495eee0123 Merge commit '40cf1bbacc6220a0aa6bed5c331871d43f9ce370'
* commit '40cf1bbacc6220a0aa6bed5c331871d43f9ce370':
  Deprecate avctx.coded_frame

Conflicts:
	ffmpeg.c
	libavcodec/a64multienc.c
	libavcodec/asvenc.c
	libavcodec/cljrenc.c
	libavcodec/dpxenc.c
	libavcodec/gif.c
	libavcodec/mpegvideo_enc.c
	libavcodec/nvenc.c
	libavcodec/proresenc_kostya.c
	libavcodec/pthread_frame.c
	libavcodec/rawenc.c
	libavcodec/sunrastenc.c
	libavcodec/tiffenc.c
	libavcodec/version.h
	libavcodec/xbmenc.c
	libavcodec/xwdenc.c
	libavdevice/v4l2.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-21 01:17:15 +02:00
Michael Niedermayer
b1fad7ac20 Merge commit 'd6604b29ef544793479d7fb4e05ef6622bb3e534'
* commit 'd6604b29ef544793479d7fb4e05ef6622bb3e534':
  Gather all coded_frame allocations and free functions to a single place

Conflicts:
	libavcodec/a64multienc.c
	libavcodec/asvenc.c
	libavcodec/cljrenc.c
	libavcodec/dpxenc.c
	libavcodec/dvenc.c
	libavcodec/gif.c
	libavcodec/huffyuvenc.c
	libavcodec/jpeglsenc.c
	libavcodec/libopenjpegenc.c
	libavcodec/libtheoraenc.c
	libavcodec/libvpxenc.c
	libavcodec/mpegvideo_enc.c
	libavcodec/nvenc.c
	libavcodec/pngenc.c
	libavcodec/proresenc_kostya.c
	libavcodec/sunrastenc.c
	libavcodec/tiffenc.c
	libavcodec/utils.c
	libavcodec/utvideoenc.c
	libavcodec/v210enc.c
	libavcodec/v410enc.c
	libavcodec/xbmenc.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-20 23:43:05 +02:00
Vittorio Giovara
40cf1bbacc Deprecate avctx.coded_frame
The rationale is that coded_frame was only used to communicate key_frame,
pict_type and quality to the caller, as well as a few other random fields,
in a non predictable, let alone consistent way.

There was agreement that there was no use case for coded_frame, as it is
a full-sized AVFrame container used for just 2-3 int-sized properties,
which shouldn't even belong into the AVCodecContext in the first place.

The appropriate AVPacket flag can be used instead of key_frame, while
quality is exported with the new AVPacketSideData quality factor.
There is no replacement for the other fields as they were unreliable,
mishandled or just not used at all.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-20 15:06:50 +01:00
Vittorio Giovara
d6604b29ef Gather all coded_frame allocations and free functions to a single place
Allocating coded_frame is what most encoders do anyway, so it makes
sense to always allocate and free it in a single place. Moreover a lot
of encoders freed the frame with av_freep() instead of the correct API
av_frame_free().

This bring uniformity to encoder behaviour and prevents applications
from erroneusly accessing this field when not allocated. Additionally
this helps isolating encoders that export information with coded_frame,
and heavily simplifies its deprecation.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-20 14:16:15 +01:00
Michael Niedermayer
73e150fff7 Merge commit '7d2a6826912b629f17f3b0c5268e334fa123c4c9'
* commit '7d2a6826912b629f17f3b0c5268e334fa123c4c9':
  huffyuv: Check memory allocation

See: 4a722a5cab
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-01 01:57:29 +02:00
Vittorio Giovara
7d2a682691 huffyuv: Check memory allocation 2015-05-31 15:03:31 +02:00
Michael Niedermayer
f2978aa7ed Merge commit '43171886e08b6a2f20a1e2f3ecc95a7984b591cd'
* commit '43171886e08b6a2f20a1e2f3ecc95a7984b591cd':
  huffyuvenc: Mark codec as init-thread-safe and init-cleanup

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-24 21:48:27 +02:00
Vittorio Giovara
43171886e0 huffyuvenc: Mark codec as init-thread-safe and init-cleanup 2015-04-24 14:55:11 +01:00
Christophe Gisquet
6ee7681723 huffyuvenc: write last odd sample
If width is odd, last sample wouldn't be written.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-25 23:12:30 +02:00
Christophe Gisquet
1467780772 huffyuvenc: add a non-deterministic option
Not actually used in huffyuvenc, but rather in setting the frame
threading.

Example for some files:
context=0:       851974   27226   1137281
context=1,ND=0:  471819   22604    972351
context=1,ND=1:  472875   22673    972582

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-08-19 13:47:18 +02:00
Michael Niedermayer
35bb74900b Merge commit 'c67b449bebbe0b35c73b203683e77a0a649bc765'
* commit 'c67b449bebbe0b35c73b203683e77a0a649bc765':
  dsputil: Split bswap*_buf() off into a separate context

Conflicts:
	configure
	libavcodec/4xm.c
	libavcodec/ac3dec.c
	libavcodec/ac3dec.h
	libavcodec/apedec.c
	libavcodec/eamad.c
	libavcodec/flacenc.c
	libavcodec/fraps.c
	libavcodec/huffyuv.c
	libavcodec/huffyuvdec.c
	libavcodec/motionpixels.c
	libavcodec/truemotion2.c
	libavcodec/x86/Makefile
	libavcodec/x86/dsputil_init.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-23 13:31:26 +02:00
Diego Biurrun
c67b449beb dsputil: Split bswap*_buf() off into a separate context 2014-06-22 18:22:31 -07:00
Christophe Gisquet
e7fc5d53a0 huffyuv: change statistics initialization
Normally, a Laplace distribution is more typical of the residuals
encoded, but for noisy input, it's both better and simpler to be
safe and use a 1/d^2 distribution. Second hunk could use some
renormalization but it has effectively little impact.

Output size of ffvhuff on various 4:2:0 sequences:
context=0,1/d:    851974   27226   1137281
context=0,1/d²:   619081   25069   1051500
context=0,1/d³:   501983   30454   1290561
context=0,lapl:   500650   31754   1304082

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-19 06:03:51 +02:00
Michael Niedermayer
334aafe565 avcodec/huffman/ff_huff_gen_len_table: support skiping stat=0 entries
This is probably not the simplest solution but as this is needed for a bugfix,
simplification is left for later.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-09 14:56:00 +02:00
Michael Niedermayer
40a4ab8ba4 rename sub_hfyu_median_prediction_int16 to sub_hfyu_median_pred_int16
This makes the naming more consistent with the 8bit variant

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-29 19:48:23 +02:00
Michael Niedermayer
48a6916308 Merge commit '512f3ffe9b4bb86767c2b1176554407c75fe1a5c'
* commit '512f3ffe9b4bb86767c2b1176554407c75fe1a5c':
  dsputil: Split off HuffYUV encoding bits into their own context

Conflicts:
	configure
	libavcodec/dsputil.c
	libavcodec/dsputil.h
	libavcodec/huffyuv.h
	libavcodec/huffyuvenc.c
	libavcodec/pngenc.c
	libavcodec/x86/dsputilenc_mmx.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-28 00:03:59 +02:00
Diego Biurrun
512f3ffe9b dsputil: Split off HuffYUV encoding bits into their own context
Also shorten HuffYUV context member names to avoid clutter.
2014-05-27 08:54:53 -07:00
Michael Niedermayer
9e58677438 avcodec/huffyuvenc: Make version 3 of ffvhuff non experimental
Tested-by: Tim Nicholson <nichot20@yahoo.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-07 23:24:38 +02:00
Michael Niedermayer
80793afb17 Merge commit '2f02bbcca050936686482453078e83dc25493da0'
* commit '2f02bbcca050936686482453078e83dc25493da0':
  build: Let the ffvhuff decoder/encoder depend on the huffyuv decoder/encoder

Conflicts:
	configure
	libavcodec/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-01 12:37:38 +01:00
Diego Biurrun
2f02bbcca0 build: Let the ffvhuff decoder/encoder depend on the huffyuv decoder/encoder
Almost all of the code is shared so there is little point in
enabling one decoder/encoder without the other.
2014-02-28 21:17:01 +01:00
Michael Niedermayer
59279bf21f avcodec/huffyuvenc: only allocate stats_out when it will be used
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-15 15:06:29 +01:00
Michael Niedermayer
bb7a711156 avcodec/huffyuvenc: frame multi-threading support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-28 14:51:42 +01:00
Michael Niedermayer
2a9c50798b avcodec/huffyuv: dont depend on bitstream_bpp having a specific value for version>2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-28 00:27:57 +01:00
Michael Niedermayer
6369766f01 avcodec/huffyuv: support gbrp9/10/12/14
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-27 02:11:29 +01:00
Michael Niedermayer
7cf8918b0d avcodec/huffyuv: update years in copyright
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-27 01:45:57 +01:00
Michael Niedermayer
599e629f88 avcodec/huffyuvenc: fix end pointer for stats_out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-26 16:24:36 +01:00
Michael Niedermayer
a301bb63f0 avcodec/huffyuvenc: fail if stats_out is too small instead of silently truncating
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-26 16:23:45 +01:00
Michael Niedermayer
53167ecfdb avcodec/huffyuv: support AV_PIX_FMT_YUV(A)4XYP16 and GRAY16
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-26 00:23:03 +01:00
Michael Niedermayer
d9779d648e Move sub_hfyu_median_prediction_int16() to losslessviddsp
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-20 23:02:58 +01:00
Michael Niedermayer
f9c7b14c04 avcdoec/huffyuvenc: optimize sub_left_prediction()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-20 22:12:56 +01:00
Michael Niedermayer
f70d7eb20c Move add/diff_int16 to lossless_videodsp
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-20 21:32:47 +01:00
Michael Niedermayer
da0684820a avcodec/dsputil/huffyuv: move diff int16 and add int16 to dsputil
This also fixes masking the bits

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-20 04:06:04 +01:00
Michael Niedermayer
2fd39642c9 avcodec/huffyuv: fix median prediction for >8bps
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-16 18:33:17 +01:00
Michael Niedermayer
3d87927959 avcodec/huffyuv: add YUVA{420,422,444}P{9,10} support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-16 17:43:24 +01:00
Michael Niedermayer
ef0282125c avcodec/huffyuv: add YUV{420,422,444}P{9,10,12,14} support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-16 17:29:58 +01:00
Michael Niedermayer
b53aab1a58 libavcodec/huffyuv: >8 bit support
This adds only yuv420p10, others are trivial to add after this commit
and will be added in a subsequent commit.
Currently the implementation is not optimized, optimizations will be
added later

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-16 16:59:15 +01:00
Michael Niedermayer
6c004e8aad avcodec/huffyuvenc: init bps from pixel descriptor
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-16 16:24:24 +01:00
Michael Niedermayer
534a89478d avcodec/huffyuv: add a field that represents the number of symbols
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-16 16:24:16 +01:00
Michael Niedermayer
7b41cbac7f avcodec/huffman: extend ff_huff_gen_len_table() to allow >8bit
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-13 01:22:43 +01:00
Michael Niedermayer
9d098ea32f avcodec/huffyuvenc: Factorize store_huffman_tables() out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 14:01:22 +01:00
Michael Niedermayer
5d4541007f avcodec/huffyuvenc: fix -context 1 encoding
Fixes Ticket3281

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 12:39:31 +01:00
Michael Niedermayer
13f3092b38 avcodec/huffyuv: add YUVA420P, YUVA422P, YUVA444P, GBRAP, GRAY8A
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-06 21:19:32 +01:00
Michael Niedermayer
60ab582a4e avcodec/huffyuv: add GRAY8 support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-06 20:00:25 +01:00
Michael Niedermayer
22f59a8cbe avcodec/huffyuv: add GBRP support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-06 19:56:52 +01:00
Michael Niedermayer
27b1e63f32 avcodec/huffyuv: Support more 8bit YUV formats
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-06 01:02:26 +01:00
Michael Niedermayer
be1e6e7503 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mpegvideo_enc: use the AVFrame API properly.
  ffv1: use the AVFrame API properly.
  jpegls: use the AVFrame API properly.
  huffyuv: use the AVFrame API properly.

Conflicts:
	libavcodec/ffv1.c
	libavcodec/ffv1.h
	libavcodec/ffv1dec.c
	libavcodec/ffv1enc.c

Changes to ffv1 are more redone than merged due to them being based on
an ancient codebase and a good part of that having being done already
as well.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-17 13:55:50 +01:00
Anton Khirnov
14b35bf065 huffyuv: use the AVFrame API properly. 2013-11-16 17:50:20 +01: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
947f2d4d34 Merge commit '55c4cba2a7037161ea56b2d55b347c8381df7f1e'
* commit '55c4cba2a7037161ea56b2d55b347c8381df7f1e':
  huffyuvenc: BGRA support

Conflicts:
	libavcodec/huffyuvenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-30 09:50:26 +02:00