1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

79 Commits

Author SHA1 Message Date
Timo Rothenpieler
1330a0f31f avcodec/nvenc: Fix forcing constqp rc mode
The CONSTQP enum value is 0, so this check failed for it.
2016-05-31 16:53:38 +02:00
Andrey Turkin
58c6dcb4b7 avcodec/nvenc: don't enqueue timestamps until a frame was accepted
Otherwise timestamps/pending FIFOs would go out of sync if nvEncodePicture ever fails.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-05-31 16:50:45 +02:00
Andrey Turkin
2f53b5b74b avcodec/nvenc: refactor encode_frame a bit
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-05-31 16:47:07 +02:00
Andrey Turkin
d3463912c1 avcodec/nvenc: extract timestamp calculations into separate function
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-05-31 16:32:03 +02:00
Andrey Turkin
0d021cc8b3 avcodec/nvenc: rework library load and GPU selection
Use explicit nvenc capability checks instead to determine usable devices
instead of SM versions.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-05-31 16:04:53 +02:00
Andrey Turkin
f052ef30ef avcodec/nvenc: allow configuring number of surfaces
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-05-31 15:48:43 +02:00
Andrey Turkin
b69335304d avcodec/nvenc: use INIT_CLEANUP to deal with init failures
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-05-31 15:48:43 +02:00
Andrey Turkin
f84dfbc74a avcodec/nvenc: add rate control option
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-05-31 15:48:43 +02:00
Andrey Turkin
40df468ab1 avcodec/nvenc: convert tier to AVOptions
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-05-31 15:48:43 +02:00
Andrey Turkin
b0172873a8 avcodec/nvenc: convert levels to AVOptions
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-05-31 15:48:43 +02:00
Andrey Turkin
9824321b32 avcodec/nvenc: convert profile parsing to AVOptions
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-05-31 15:48:43 +02:00
Andrey Turkin
faffff88c2 avcodec/nvenc: use AVOptions to select presets
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-05-31 15:48:43 +02:00
Andrey Turkin
7aa16d59bf avcodec/nvenc: split H264/HEVC encoder definitions into separate files
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-05-31 11:15:19 +00:00
Timo Rothenpieler
24fcb23351 avcodec/nvenc: Require Maxwell for lossless 2016-05-25 12:16:54 +02:00
Andrey Turkin
a8cf25dd92 avcodec/nvenc: CUDA frames support
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-05-25 12:16:48 +02:00
Andrey Turkin
cfb49fc6f7 avcodec/nvenc: replace custom FIFOs with AVFifos
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-05-25 12:16:45 +02:00
Andrey Turkin
e1691c44f0 avcodec/nvenc: combine input and output surface structures
There is no point in separate structures as they have 1:1 relationship,
they are always used together and they have same lifetime.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-05-25 12:16:40 +02:00
Andrey Turkin
82d705e245 avcodec/nvenc: split large functions into smaller ones
Functions names and scopes are from libav. This commit basically moves
code around without changing it; it shouldn't change any functionality
except some small leak fixes on error paths.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-05-25 12:16:33 +02:00
Timo Rothenpieler
c921ca9b5d avcodec/nvenc: Write buffPeriod/picTime SEI in both CBR modes 2016-05-11 12:58:52 +02:00
Timo Rothenpieler
3a9df7dfec avcodec/nvenc: Generate bufferingPeriod/pictureTiming SEI
For some unknown reason enabling these causes propper CBR padding,
so as there are no known downsides just always enable them in CBR mode.
2016-05-11 10:34:31 +02:00
Timo Rothenpieler
31ce01bdb9 avcodec/nvenc: don't set profile in lossless mode 2016-05-06 10:15:29 +02:00
Timo Rothenpieler
c4312b1cf4 avcodec/nvenc: Add missing lossless presets to doc string 2016-04-27 22:22:29 +02:00
Timo Rothenpieler
b3557c79dc avcodec/nvenc: Generate AUD NAL units for better compatiblity 2016-03-30 12:03:59 +02:00
Timo Rothenpieler
f2bdf9d26a avcodec/nvenc: Fix typo and preset error message 2016-03-08 11:18:16 +01:00
Lucas Cooper
fd55470c65 avcodec/nvenc: Add encoder stats
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-03-08 10:41:07 +01:00
Agatha Hu
362e05f1ea avcodec/nvenc: Fix H264 and HEVC vui info update
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2016-03-04 10:49:33 +01:00
Hendrik Leppkes
5fc17edc7d Merge commit '1520c6ff05d835da4b793318fc88bbbc129c86a1'
* commit '1520c6ff05d835da4b793318fc88bbbc129c86a1':
  nvenc: export CPB props side data

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
2015-12-17 13:41:29 +01:00
Agatha Hu
758be45756 avcodec/nvenc: clamp initial qp value to [1, 51]
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2015-12-14 10:34:59 +01:00
Agatha Hu
f1a8897375 avcodec/nvenc: set slice number to 1 to improve encoding quality
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2015-12-14 10:27:36 +01:00
Anton Khirnov
1520c6ff05 nvenc: export CPB props side data 2015-12-06 10:25:43 +01:00
Agatha Hu
ddbad15898 avcodec/nvenc: update nvenc default parameters
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2015-11-09 13:05:02 +01:00
Agatha Hu
20abda6b62 avcodec/nvenc: fix potential profile error when encoding yuv444p
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2015-10-31 16:00:39 +01:00
Agatha Hu
2b5dda3f48 avcodec/nvenc: fix b frame n_quant_offset
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2015-10-16 18:24:10 +02:00
Agatha Hu
a8bedd56aa avcodec/nvenc: merge compute initialQP sections
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2015-09-14 14:10:09 +02:00
Agatha Hu
49046580ce avcodec/nvenc: Optimize nvenc parameters
Add 3 more presets: fast, medium, slow.
Improve min/max QP calculation.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2015-09-14 14:10:08 +02:00
Agatha Hu
81071eea7d avcodec/nvenc: change flag of cuCtxCreate to avoid CPU spins
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2015-09-11 10:11:29 +02:00
Luca Barbato
413d4e54a9 nvenc: Properly free the fifos
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-08-25 19:47:43 +02:00
Timo Rothenpieler
2ae45816b2 avcodec/nvenc: Add support for 2pass rc in vbr mode
Thanks to WereCatf for pointing out this now exists.

Github: Closes #143
2015-08-04 21:38:10 +02:00
Timo Rothenpieler
3a20e5bc3b avcodec/nvenc: Only set h264 parameter when encoding h264 2015-08-04 21:38:10 +02:00
Timo Rothenpieler
bef740688d avcodec/nvenc: Fix indentation 2015-08-04 21:38:10 +02:00
Michael Niedermayer
29d147c94d Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'
* commit '059a934806d61f7af9ab3fd9f74994b838ea5eba':
  lavc: Consistently prefix input buffer defines

Conflicts:
	doc/examples/decoding_encoding.c
	libavcodec/4xm.c
	libavcodec/aac_adtstoasc_bsf.c
	libavcodec/aacdec.c
	libavcodec/aacenc.c
	libavcodec/ac3dec.h
	libavcodec/asvenc.c
	libavcodec/avcodec.h
	libavcodec/avpacket.c
	libavcodec/dvdec.c
	libavcodec/ffv1enc.c
	libavcodec/g2meet.c
	libavcodec/gif.c
	libavcodec/h264.c
	libavcodec/h264_mp4toannexb_bsf.c
	libavcodec/huffyuvdec.c
	libavcodec/huffyuvenc.c
	libavcodec/jpeglsenc.c
	libavcodec/libxvid.c
	libavcodec/mdec.c
	libavcodec/motionpixels.c
	libavcodec/mpeg4videodec.c
	libavcodec/mpegvideo.c
	libavcodec/noise_bsf.c
	libavcodec/nuv.c
	libavcodec/nvenc.c
	libavcodec/options.c
	libavcodec/parser.c
	libavcodec/pngenc.c
	libavcodec/proresenc_kostya.c
	libavcodec/qsvdec.c
	libavcodec/svq1enc.c
	libavcodec/tiffenc.c
	libavcodec/truemotion2.c
	libavcodec/utils.c
	libavcodec/utvideoenc.c
	libavcodec/vc1dec.c
	libavcodec/wmalosslessdec.c
	libavformat/adxdec.c
	libavformat/aiffdec.c
	libavformat/apc.c
	libavformat/apetag.c
	libavformat/avidec.c
	libavformat/bink.c
	libavformat/cafdec.c
	libavformat/flvdec.c
	libavformat/id3v2.c
	libavformat/isom.c
	libavformat/matroskadec.c
	libavformat/mov.c
	libavformat/mpc.c
	libavformat/mpc8.c
	libavformat/mpegts.c
	libavformat/mvi.c
	libavformat/mxfdec.c
	libavformat/mxg.c
	libavformat/nutdec.c
	libavformat/oggdec.c
	libavformat/oggparsecelt.c
	libavformat/oggparseflac.c
	libavformat/oggparseopus.c
	libavformat/oggparsespeex.c
	libavformat/omadec.c
	libavformat/rawdec.c
	libavformat/riffdec.c
	libavformat/rl2.c
	libavformat/rmdec.c
	libavformat/rtpdec_latm.c
	libavformat/rtpdec_mpeg4.c
	libavformat/rtpdec_qdm2.c
	libavformat/rtpdec_svq3.c
	libavformat/sierravmd.c
	libavformat/smacker.c
	libavformat/smush.c
	libavformat/spdifenc.c
	libavformat/takdec.c
	libavformat/tta.c
	libavformat/utils.c
	libavformat/vqf.c
	libavformat/westwood_vqa.c
	libavformat/xmv.c
	libavformat/xwma.c
	libavformat/yop.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27 23:15:19 +02: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
Michael Niedermayer
94d68a41fa Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'
* commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615':
  lavc: AV-prefix all codec flags

Conflicts:
	doc/examples/muxing.c
	ffmpeg.c
	ffmpeg_opt.c
	ffplay.c
	libavcodec/aacdec.c
	libavcodec/aacenc.c
	libavcodec/ac3dec.c
	libavcodec/ac3enc_float.c
	libavcodec/atrac1.c
	libavcodec/atrac3.c
	libavcodec/atrac3plusdec.c
	libavcodec/dcadec.c
	libavcodec/ffv1enc.c
	libavcodec/h264.c
	libavcodec/h264_loopfilter.c
	libavcodec/h264_mb.c
	libavcodec/imc.c
	libavcodec/libmp3lame.c
	libavcodec/libtheoraenc.c
	libavcodec/libtwolame.c
	libavcodec/libvpxenc.c
	libavcodec/libxavs.c
	libavcodec/libxvid.c
	libavcodec/mpeg12dec.c
	libavcodec/mpeg12enc.c
	libavcodec/mpegaudiodec_template.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo_enc.c
	libavcodec/mpegvideo_motion.c
	libavcodec/nellymoserdec.c
	libavcodec/nellymoserenc.c
	libavcodec/nvenc.c
	libavcodec/on2avc.c
	libavcodec/options_table.h
	libavcodec/opus_celt.c
	libavcodec/pngenc.c
	libavcodec/ra288.c
	libavcodec/ratecontrol.c
	libavcodec/twinvq.c
	libavcodec/vc1_block.c
	libavcodec/vc1_loopfilter.c
	libavcodec/vc1_mc.c
	libavcodec/vc1dec.c
	libavcodec/vorbisdec.c
	libavcodec/vp3.c
	libavcodec/wma.c
	libavcodec/wmaprodec.c
	libavcodec/x86/hpeldsp_init.c
	libavcodec/x86/me_cmp_init.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27 22:10:35 +02:00
Vittorio Giovara
059a934806 lavc: Consistently prefix input buffer defines
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27 15:24:59 +01:00
Vittorio Giovara
7c6eb0a1b7 lavc: AV-prefix all codec flags
Convert doxygen to multiline and express bitfields more simply.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27 15:24:58 +01:00
Michael Niedermayer
e36db49b7b avcodec: Add a min size parameter to ff_alloc_packet2()
This parameter can be used to inform the allocation code about how much
downsizing might occur, and can be used to optimize how to allocate the
packet

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-27 19:57:52 +02:00
WereCatf
7106dfd945 avcodec/nvenc: 2-pass mode works even with non-low latency presets now
Github: Closes #140

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2015-07-26 17:40:56 +02:00
Timo Rothenpieler
9f4bff834c avcodec/nvenc: Delay frame output to increase encoding speed 2015-07-26 00:52:15 +02:00
Timo Rothenpieler
15cd2f8ea9 avcodec/nvenc: Remove unused parameter 2015-07-25 23:43:16 +02:00
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