summaryrefslogtreecommitdiff
path: root/libavcodec/nvenc.c
Commit message (Collapse)AuthorAge
* Merge commit '1520c6ff05d835da4b793318fc88bbbc129c86a1'Hendrik Leppkes2015-12-17
|\ | | | | | | | | | | | | * commit '1520c6ff05d835da4b793318fc88bbbc129c86a1': nvenc: export CPB props side data Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * nvenc: export CPB props side dataAnton Khirnov2015-12-06
| |
| * nvenc: Properly free the fifosLuca Barbato2015-08-25
| | | | | | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avcodec/nvenc: clamp initial qp value to [1, 51]Agatha Hu2015-12-14
| | | | | | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* | avcodec/nvenc: set slice number to 1 to improve encoding qualityAgatha Hu2015-12-14
| | | | | | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* | avcodec/nvenc: update nvenc default parametersAgatha Hu2015-11-09
| | | | | | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* | avcodec/nvenc: fix potential profile error when encoding yuv444pAgatha Hu2015-10-31
| | | | | | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* | avcodec/nvenc: fix b frame n_quant_offsetAgatha Hu2015-10-16
| | | | | | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* | avcodec/nvenc: merge compute initialQP sectionsAgatha Hu2015-09-14
| | | | | | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* | avcodec/nvenc: Optimize nvenc parametersAgatha Hu2015-09-14
| | | | | | | | | | | | | | Add 3 more presets: fast, medium, slow. Improve min/max QP calculation. Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* | avcodec/nvenc: change flag of cuCtxCreate to avoid CPU spinsAgatha Hu2015-09-11
| | | | | | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* | avcodec/nvenc: Add support for 2pass rc in vbr modeTimo Rothenpieler2015-08-04
| | | | | | | | | | | | Thanks to WereCatf for pointing out this now exists. Github: Closes #143
* | avcodec/nvenc: Only set h264 parameter when encoding h264Timo Rothenpieler2015-08-04
| |
* | avcodec/nvenc: Fix indentationTimo Rothenpieler2015-08-04
| |
* | Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-27
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* | Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * lavc: AV-prefix all codec flagsVittorio Giovara2015-07-27
| | | | | | | | | | | | Convert doxygen to multiline and express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | avcodec: Add a min size parameter to ff_alloc_packet2()Michael Niedermayer2015-07-27
| | | | | | | | | | | | | | | | 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>
* | avcodec/nvenc: 2-pass mode works even with non-low latency presets nowWereCatf2015-07-26
| | | | | | | | | | | | Github: Closes #140 Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* | avcodec/nvenc: Delay frame output to increase encoding speedTimo Rothenpieler2015-07-26
| |
* | avcodec/nvenc: Remove unused parameterTimo Rothenpieler2015-07-25
| |
* | Merge commit '40cf1bbacc6220a0aa6bed5c331871d43f9ce370'Michael Niedermayer2015-07-21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * Deprecate avctx.coded_frameVittorio Giovara2015-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge commit 'd6604b29ef544793479d7fb4e05ef6622bb3e534'Michael Niedermayer2015-07-20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
| * Gather all coded_frame allocations and free functions to a single placeVittorio Giovara2015-07-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * nvenc: Fix NV12 inputLuca Barbato2015-06-26
| |
| * nvenc: H264 and HEVC encodersLuca Barbato2015-05-31
| | | | | | Partially based on the work of Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* avcodec/nvenc: Fix build with older gcc versionsTimo Rothenpieler2015-07-14
| | | | | Aparently anonymous structs weren't always supported, not even sure if they are standard conformant.
* avcodec/nvenc: Add support for H.264 High 444 Predictive encodingPhilip Langdale2015-07-05
| | | | | | | | | | | | | | | | Newer versions of the nvenc hardware support The High 444 Predictive profile of H.264, and can also do lossless encoding under this profile if desired. This change introduces support for the profile, and exposes the appropriate presets for requesting lossless encoding. I tested lossless by generating a baseline sample with testsrc converted to raw yuv444p, then encoded the sample with nvenc, then did a framemd5 comparision of both the raw video and the nvenc encode. The framemd5 reports were identical. Signed-off-by: Philip Langdale <philipl@overt.org> Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: Enable YV12 input formatPhilip Langdale2015-06-13
| | | | | | This has been enabled by recent nvidia driver releases. Signed-off-by: Philip Langdale <philipl@overt.org>
* avcodec/nvenc: Add 'nvenc_h264' as an alternative name for 'nvenc'Philip Langdale2015-06-06
| | | | | | | | This allows us to offer the same codec name that libav uses. We don't have a special way to do aliases, so it's all a bit more verbose than you'd want but such is life. Signed-off-by: Philip Langdale <philipl@overt.org>
* avcodec/nvenc: Rename nvenc_h265 to nvenc_hevcPhilip Langdale2015-06-06
| | | | | | | For the sake of compatibility, and because pretty much everything else in the codebase calls it HEVC. Signed-off-by: Philip Langdale <philipl@overt.org>
* Revert "avcodec: Rename nvenc.c to nvenc_a.c, to avoid conflict with the ↵Philip Langdale2015-06-06
| | | | | | | | other implementation" This reverts commit d0d0913702358c61dfb9c5ac8b141cd203524869. Signed-off-by: Philip Langdale <philipl@overt.org>
* avcodec: Rename nvenc.c to nvenc_a.c, to avoid conflict with the other ↵Michael Niedermayer2015-06-01
| | | | | | implementation Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/nvenc: Fix typo: 1204 -> 1024Philip Langdale2015-05-26
| | | | | | Fixes Ticket4508 Signed-off-by: Philip Langdale <philipl@overt.org>
* avcodec/nvenc: Make pix_fmts_nvenc constMichael Niedermayer2015-05-03
| | | | | Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/nvenc: Add options for level and tierTimo Rothenpieler2015-04-09
| | | | | Previous version reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/nvenc: Fix profile parameter handlingTimo Rothenpieler2015-04-02
| | | | | | | | | | | It was not possible to set a profile before, the builtin profile parameter does not seem to work propperly. To be compatible with libx264, this overlays it with a local parameter that expects a string, instead of an int, that takes the well known values "high", "main" or "baseline". Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/nvenc: Fix typoed nv_status checksTimo Rothenpieler2015-04-01
| | | | | | Thanks to Wyatt Aaron for pointing this out Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/nvenc: Need a separate class for each encoderPhilip Langdale2015-03-25
| | | | | | The encoders can't share a class instance. Signed-off-by: Philip Langdale <philipl@overt.org>
* avcodec/nvenc: Add support for H.265 encodingPhilip Langdale2015-03-24
| | | | | | | | | | | | | Sufficiently new nvenc hardware (GM20x or later) has support for H.265 encoding. This works the same as the H.264 encoder except the codec parameters are different. Due to the fact that common codec parameters are not shareable, there's quite a bit of conditional logic you'd wish we could do without, but such is life. Signed-off-by: Philip Langdale <philipl@overt.org> Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/nvenc: Drop support for old nvenc apiTimo Rothenpieler2015-03-24
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/nvenc: De-compensate aspect ratio compensation of DVD-like content.Philip Langdale2015-02-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For reasons we are not privy to, nvidia decided that the nvenc encoder should apply aspect ratio compensation to 'DVD like' content, assuming that the content is not bt.601 compliant, but needs to be bt.601 compliant. In this context, that means that they make the following, questionable, assumptions: 1) If the input dimensions are 720x480 or 720x576, assume the content has an active area of 704x480 or 704x576. 2) Assume that whatever the input sample aspect ratio is, it does not account for the difference between 'physical' and 'active' dimensions. From, these assumptions, they then conclude that they can 'help', by adjusting the sample aspect ratio by a factor of 45/44. And indeed, if you wanted to display only the 704 wide active area with the same aspect ratio as the full 720 wide image - this would be the correct adjustment factor, but what if you don't? And more importantly, what if you're used to ffmpeg not making this kind of adjustment at encode time - because none of the other encoders do this! And, what if you had already accounted for bt.601 and your input had the correct attributes? Well, it's going to apply the compensation anyway! So, if you take some content, and feed it through nvenc repeatedly, it will keep scaling the aspect ratio every time, stretching your video out more and more and more. So, clearly, regardless of whether you want to apply bt.601 aspect ratio adjustments or not, this is not the way to do it. With any other ffmpeg encoder, you would do it as part of defining your input paramters or do the adjustment at playback time, and there's no reason by nvenc should be any different. This change adds some logic to undo the compensation that nvenc would otherwise do. nvidia engineers have told us that they will work to make this compensation mechanism optional in a future release of the nvenc SDK. At that point, we can adapt accordingly. Signed-off-by: Philip Langdale <philipl@overt.org> Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/nvenc: Handle non-square pixel aspect ratiosTimo Rothenpieler2015-01-28
| | | | | Reviewed-by: Philip Langdale <philipl@overt.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/nvenc: Fix b-frame parameter handlingTimo Rothenpieler2015-01-26
| | | | | | | | This should behave similar to x264 and other encoders, as it handles a gop_size of 0 as Intra-Only, while it's still possible to control how many B-Frames it inserts. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* nvenc: Propagate desired number of reference frames.Philip Langdale2015-01-24
| | | | | Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/nvenc: set repeatSPSPPS flag for streamingagathah2015-01-21
| | | | | Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* avcodec/nvenc: Add support for nvenc api version 5Timo Rothenpieler2015-01-17
| | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>