Commit Graph

22 Commits

Author SHA1 Message Date
Jun Zhao
cf9c9a9db9 lavc/libkvazaar: fix memory leak after av_dict_parse_string fail
In case of failure, all the successfully set entries are stored in
*pm. We need to manually free the created dictionary to avoid
memory leak.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2020-01-04 09:04:58 +08:00
Jun Zhao
3f08ed3920 lavc/libkvazaar: indent the code
indent the code to follow FFmpeg's coding style

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-12-20 18:40:41 +08:00
Jun Zhao
59deae5d1c lavc/libkvazaar: Use avctx->frame_rate first for framerate setting
perfer avctx->frame_rate first than use avctx->time_base when setting
the frame rate to encoder.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-12-20 18:40:41 +08:00
Jun Zhao
72b047a7a7 lavc/kvazaar: fix auto thread flag in kvazaar wrapper.
Now the kvazaar warpper didn't setting the threads for kvazaar API,
and kavzaar will auto selecte the thread number.

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-12-02 11:05:28 +08:00
Jun Zhao
e2921578c0 lavc/libkvazaar: fix incompatible pointer type.
fix the waring: libavcodec/libkvazaar.c:210:27: warning: passing argument 3 of ‘av_image_copy’ from incompatible pointer type [-Wincompatible-pointer-types]
                           frame->data, frame->linesize,
                           ^~~~~
In file included from libavcodec/libkvazaar.c:31:0:
./libavutil/imgutils.h:119:6: note: expected ‘const uint8_t ** {aka const unsigned char **}’ but argument is of type ‘uint8_t * const* {aka unsigned char * const*}’
 void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4],

Signed-off-by: Jun Zhao <mypopydev@gmail.com>
2018-08-22 19:06:12 +08:00
wm4
b945fed629 avcodec: add metadata to identify wrappers and hardware decoders
Explicitly identify decoder/encoder wrappers with a common name. This
saves API users from guessing by the name suffix. For example, they
don't have to guess that "h264_qsv" is the h264 QSV implementation, and
instead they can just check the AVCodec .codec and .wrapper_name fields.

Explicitly mark AVCodec entries that are hardware decoders or most
likely hardware decoders with new AV_CODEC_CAPs. The purpose is allowing
API users listing hardware decoders in a more generic way. The proposed
AVCodecHWConfig does not provide this information fully, because it's
concerned with decoder configuration, not information about the fact
whether the hardware is used or not.

AV_CODEC_CAP_HYBRID exists specifically for QSV, which can have software
implementations in case the hardware is not capable.

Based on a patch by Philip Langdale <philipl@overt.org>.

Merges Libav commit 47687a2f8a.
2017-12-14 19:37:56 +01:00
Jun Zhao
2c6b0315d9 lavc/libkvazaar: switch to ff_alloc_packet2.
ff_alloc_packet have been deprecated, switch to use the
ff_alloc_packet2.

Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Reviewed-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-11-10 00:53:11 +01:00
James Almer
f416a8d66a Merge commit 'd5759701a82926059ae3e2530805e900041a5419'
* commit 'd5759701a82926059ae3e2530805e900041a5419':
  libkvazaar: Add missing header #includes

Merged-by: James Almer <jamrial@gmail.com>
2017-04-13 18:18:54 -03:00
Diego Biurrun
d5759701a8 libkvazaar: Add missing header #includes
This fixes compilation after the next version bump.
2016-12-08 21:34:30 +01:00
Arttu Ylä-Outinen
7d1e985528 libkvazaar: Set frame rate as a rational number
Updates libkvazaar to pass the exact frame rate to Kvazaar by setting
the numerator and denominator separately instead of a single floating
point number. The exact frame rate is needed for writing timing info to
the bitstream.

Requires Kvazaar version 0.8.1.

Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
2016-01-20 17:29:13 +02:00
Arttu Ylä-Outinen
472d488ebc libkvazaar: Set frame rate as a rational number
Updates libkvazaar to pass the exact frame rate to Kvazaar by setting
the numerator and denominator separately instead of a single floating
point number. The exact frame rate is needed for writing timing info to
the bitstream.

Requires Kvazaar version 0.8.1.

Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2016-01-19 20:47:49 +01:00
Hendrik Leppkes
8dde5dc05a Merge commit '233d2fa0443197df12b4f7823d591dad964149b3'
* commit '233d2fa0443197df12b4f7823d591dad964149b3':
  kvazaar: Add libkvazaar HEVC encoder

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-10-27 13:49:37 +01:00
Arttu Ylä-Outinen
233d2fa044 kvazaar: Add libkvazaar HEVC encoder
Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-23 11:59:27 +02:00
Arttu Ylä-Outinen
cb8999f368 doc/encoders: Fix libkvazaar documentation
The -threads option is ignored with libkvazaar since it does not have
any of the AV_CODEC_CAP_{FRAME,SLICE,AUTO}_THREADS capabilities. This
commit removes the incorrect documentation as well as the no-op of
setting the number of threads in libkvazaar encoder.

Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
2015-10-07 17:09:13 +03:00
Arttu Ylä-Outinen
0e34868387 libkvazaar: Fix setting framerate
The divisor and dividend in the equation had been swapped, making the
result the inverse of the actual framerate.

Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
2015-10-07 17:09:10 +03:00
Arttu Ylä-Outinen
5fefa7b512 libkvazaar: Use av_image_copy for copying pixels
Replaces a for loop for copying pixels by a call to av_image_copy.

Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
2015-10-07 17:09:08 +03:00
Arttu Ylä-Outinen
8db62f0419 libkvazaar: Set pts and dts
Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
2015-10-07 17:09:05 +03:00
Arttu Ylä-Outinen
c09419ca80 libkvazaar: Replace asserts with proper errors
Changes function libkvazaar_encode to return proper error codes instead
of crashing when the video dimensions or pixel format change in the
middle of encoding.

Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
2015-10-07 17:09:02 +03:00
Arttu Ylä-Outinen
425d6134ed libkvazaar: Remove unnecessary NULL checks
Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
2015-10-07 17:09:00 +03:00
Arttu Ylä-Outinen
b3777b2c2e libkvazaar: Update to work with the latest version
Function encoder_encode in Kvazaar API was changed to have new output
parameters: source picture and frame info. Frame info is used to set the
keyframe flag and source picture is ignored.

Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
2015-10-07 16:43:34 +03:00
Michael Niedermayer
444e9874a7 Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'
* commit 'def97856de6021965db86c25a732d78689bd6bb0':
  lavc: AV-prefix all codec capabilities

Conflicts:
	cmdutils.c
	ffmpeg.c
	ffplay.c
	libavcodec/8svx.c
	libavcodec/aacenc.c
	libavcodec/ac3dec.c
	libavcodec/adpcm.c
	libavcodec/alac.c
	libavcodec/atrac3plusdec.c
	libavcodec/bink.c
	libavcodec/dnxhddec.c
	libavcodec/dvdec.c
	libavcodec/dvenc.c
	libavcodec/ffv1dec.c
	libavcodec/ffv1enc.c
	libavcodec/fic.c
	libavcodec/flacdec.c
	libavcodec/flacenc.c
	libavcodec/flvdec.c
	libavcodec/fraps.c
	libavcodec/frwu.c
	libavcodec/gifdec.c
	libavcodec/h261dec.c
	libavcodec/hevc.c
	libavcodec/iff.c
	libavcodec/imc.c
	libavcodec/libopenjpegdec.c
	libavcodec/libvo-aacenc.c
	libavcodec/libvorbisenc.c
	libavcodec/libvpxdec.c
	libavcodec/libvpxenc.c
	libavcodec/libx264.c
	libavcodec/mjpegbdec.c
	libavcodec/mjpegdec.c
	libavcodec/mpegaudiodec_float.c
	libavcodec/msmpeg4dec.c
	libavcodec/mxpegdec.c
	libavcodec/nvenc_h264.c
	libavcodec/nvenc_hevc.c
	libavcodec/pngdec.c
	libavcodec/qpeg.c
	libavcodec/ra288.c
	libavcodec/rv10.c
	libavcodec/s302m.c
	libavcodec/sp5xdec.c
	libavcodec/takdec.c
	libavcodec/tiff.c
	libavcodec/tta.c
	libavcodec/utils.c
	libavcodec/v210dec.c
	libavcodec/vp6.c
	libavcodec/vp9.c
	libavcodec/wavpack.c
	libavcodec/yop.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27 22:50:18 +02:00
Arttu Ylä-Outinen
b90b6af710 avcodec: add libkvazaar HECV encoder
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-14 18:00:36 +02:00