Commit Graph

76 Commits

Author SHA1 Message Date
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
Michael Niedermayer
b97e3e11a9 Merge commit '10a9149de242c7bbc4e130d3d7c593b89e20f80e'
* commit '10a9149de242c7bbc4e130d3d7c593b89e20f80e':
  ffv1enc: Keep coded_frame.key_frame a write-only variable

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

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-20 22:25:53 +02: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
Vittorio Giovara
10a9149de2 ffv1enc: Keep coded_frame.key_frame a write-only variable 2015-07-20 14:13:42 +01:00
Vittorio Giovara
75c1ed2e4c ffv1enc: Use input frame to set SAR and interlacing 2015-07-20 14:13:42 +01:00
Michael Niedermayer
749f85496c avcodec/ffv1enc: fix assertion failure with unset bits per raw sample
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-20 02:11:48 +02:00
Michael Niedermayer
3a6a8f6ee1 avcodec/ffv1enc: fix bps for >8bit yuv when not explicitly set
Fixes Ticket4636

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-18 01:01:06 +02:00
Michael Niedermayer
4b8a819496 avcodec/ffv1enc: set bits_per_raw_sample for 8bit based formats
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-26 21:23:14 +02:00
Michael Niedermayer
81e40c26e1 avcodec/ffv1enc: Ensure that bits per raw sample is valid
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-26 21:09:17 +02:00
Michael Niedermayer
8f7b022c8c Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'
* commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25':
  lavc: Replace av_dlog and tprintf with internal macros

Conflicts:
	libavcodec/aacdec.c
	libavcodec/audio_frame_queue.c
	libavcodec/bitstream.c
	libavcodec/dcadec.c
	libavcodec/dnxhddec.c
	libavcodec/dvbsubdec.c
	libavcodec/dvdec.c
	libavcodec/dvdsubdec.c
	libavcodec/get_bits.h
	libavcodec/gifdec.c
	libavcodec/h264.h
	libavcodec/h264_cabac.c
	libavcodec/h264_cavlc.c
	libavcodec/h264_loopfilter.c
	libavcodec/h264_refs.c
	libavcodec/imc.c
	libavcodec/interplayvideo.c
	libavcodec/jpeglsdec.c
	libavcodec/libopencore-amr.c
	libavcodec/mjpegdec.c
	libavcodec/mpeg12dec.c
	libavcodec/mpegvideo_enc.c
	libavcodec/mpegvideo_parser.c
	libavcodec/pngdec.c
	libavcodec/ratecontrol.c
	libavcodec/rv10.c
	libavcodec/svq1dec.c
	libavcodec/vqavideo.c
	libavcodec/wmadec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-20 04:10:10 +02:00
Vittorio Giovara
6a85dfc830 lavc: Replace av_dlog and tprintf with internal macros 2015-04-19 12:41:59 +01:00
Carl Eugen Hoyos
bf4bd427dd lavc/ffv1enc: Auto-select -coder 1 for >8bit also for yuv.
Reported-by: Christoph Gerstbauer
2015-03-09 10:40:16 +01:00
Michael Niedermayer
fbae0ac3e4 avcodec/ffv1enc: Use av_clip_uint8()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-21 15:50:19 +01:00
Michael Niedermayer
9198397115 avcodec/ffv1enc: Fix incompatible pointer type warning
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 22:05:13 +01:00
Michael Niedermayer
3b3782d74e Merge commit '0352ff102d62ee94e79e0baaf64d5ad4e66f907b'
* commit '0352ff102d62ee94e79e0baaf64d5ad4e66f907b':
  ffv1: const correctness for encode_rgb_frame()

Conflicts:
	libavcodec/ffv1enc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-06 22:05:06 +01:00
Diego Biurrun
0352ff102d ffv1: const correctness for encode_rgb_frame()
libavcodec/ffv1enc.c:922:53: warning: passing argument 5 of ‘encode_rgb_frame’ discards ‘const’ qualifier from pointer target type
2015-01-05 15:35:39 +01:00
Michael Niedermayer
e266e186cf Merge commit '6abe7edabb7d57e82d7ea6312d30cf05d2192c5b'
* commit '6abe7edabb7d57e82d7ea6312d30cf05d2192c5b':
  ffv1: fix out-of-bounds read

The change should be harmless but theres no out of array access before
the change

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-13 13:46:54 +01:00
Vittorio Giovara
6abe7edabb ffv1: fix out-of-bounds read
CC: libav-stable@libav.org
Bug-Id: CID 1047234
2014-11-13 01:41:26 +01:00
Reimar Döffinger
6724254118 ffv1enc: reduce stack usage.
A bit more complex than e.g. adding it to the context, but
using the context for something that will be used only during
initialization seemed a bit wasteful.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-09-03 21:22:58 +02:00
Michael Niedermayer
947ed8f292 avcodec/ffv1enc: allocate padding for extradata
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-05-18 15:58:41 +02:00
Lukasz Marek
a91d9e4b63 lavc/ffv1enc: add const to silent warning
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-15 01:50:47 +01:00
Michael Niedermayer
9e7b477c8c avcodec/ffv1enc: choose 1.2 by default for higher resolutions to ensure multi-threaded decodability
Reviewed-by: "Peter B." <pb@das-werkstatt.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-08 13:24:37 +01:00
Michael Niedermayer
0e575c24d6 ffv1.4: use 2 coefficients for calculating the Y plane in the RCT
0-0.7% improved compression

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-10 03:16:58 +01:00
Michael Niedermayer
2bdda9a15c avcodec/ffv1enc: fix use of uninitalized variable in choose_rct_params()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-10 02:53:04 +01:00
Michael Niedermayer
b07da13ac0 avcodec/ffv1enc: support forcing experimental 1.4 version
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-09 00:39:02 +01:00
Michael Niedermayer
7854d2d251 avcodec/ffv1: support adjusting the g vs r + b coefficient in the RCT
about 1% better compression

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-12-09 00:37:38 +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
a6064b12b4 ffv1: use the AVFrame API properly. 2013-11-16 17:50:51 +01:00
Michael Niedermayer
336a1902d6 avcodec/ffv1enc: Check high bpp RGB against coder type too
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-03 22:18:47 +01:00
Michael Niedermayer
1fb3b494fa ffv1enc: store 2pass statistics at the end
This reduces their size from O(n) to O(1)

Fixes Ticket3078

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-02 22:52:52 +01:00
Michael Niedermayer
8d88ed9a1f avcodec/ffv1enc: pass through pts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-11-02 22:52:52 +01:00
Michael Niedermayer
62533eab6f ffv1enc: use 64bit in maxsize calculation
This isnt needed but it cant hurt, its also more consistent with
how its calculated a few lines before.

See: CID1108593
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-19 23:36:35 +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
Paul B Mahol
d1a16564a2 avcodec/ffv1: YUVA(444,422,420) 9, 10 and 16 bit support
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2013-09-09 19:49:37 +00:00
Michael Niedermayer
3576b564ec avcodec/ffv1enc: encode slice as raw PCM in 1.4 when the buffer is too small.
This limits the maximum size of encoded slices more tightly

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-09 20:20:21 +02:00
Michael Niedermayer
77f521d9e5 avcodec/ffv1enc: check encode_line()s return code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-09 20:19:24 +02:00
Michael Niedermayer
3728603f18 avcodec/ffv1enc: update buffer check for 16bps
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-09 20:19:17 +02:00
Michael Niedermayer
904a2864bd avcodec/ffv1enc: fix size used for ff_alloc_packet2()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-09-09 20:19:08 +02:00
Michael Niedermayer
abe76b851c ffv1enc: Make ffv1.3 non experimental
The fate tests change as they used 1.2 previously
The increased size is due to:
32bit CRCs per slice by default (can be disabled),
it adds slice headers to allow decoding one slice without the others
an additional slice size field is added to make it possible to find
slices within corrupted surroundings.

these add up to about 57bit per slice more
at 50 frames and 4 slices thats 1425 byte

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-26 17:33:53 +02:00
Michael Niedermayer
d9b0b54a5f ffv1: rename minor to micro version
the version is 1.3.4 which makes 4 micro and not minor

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-20 03:30:36 +02:00
Michael Niedermayer
2c1a215ddb ffv1: update years in header
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-17 01:43:30 +02:00
Michael Niedermayer
c8d89be477 ffv1enc: propagate error code from write_extradata()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-17 01:43:30 +02:00
Michael Niedermayer
eeb3fb9e62 ffv1enc: check for malloc failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-17 01:43:30 +02:00
Michael Niedermayer
23606f27f0 avcodec/ffv1enc: bump minor_version for the chroma_plane fix
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-15 13:49:21 +02:00
Michael Niedermayer
1a01147d7a avcodec/ffv1enc: fix chroma_plane for rgb/rgba
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-15 13:27:29 +02:00
Michael Niedermayer
c387c45e83 ffv1: fix plane_count at version 1.4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-15 13:03:53 +02:00
Carl Eugen Hoyos
0915b531bc Rename "AVClass class" as "AVClass component_class".
The aix header math.h defines "extern int class()" for C.
2013-06-30 13:47:45 +02:00
Michael Niedermayer
7e99d528f9 ffv1enc: Check return value of av_frame_ref()
Fixes CID1026740
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-03 14:06:25 +02:00
Anton Khirnov
e6c4ac7b5f pixdesc: rename PIX_FMT_* flags to AV_PIX_FMT_FLAG_* 2013-05-15 07:46:51 +02:00