Re: [FFmpeg-devel] [PATCH] nvenc.c Fix H264 and HEVC vui info update
On Thu, Mar 03, 2016 at 22:50:10 -0800, Timothy Gu wrote: > This patched is corrupted by your mail client. What's wrong with the first > patch you sent (with git-send-email)? While the first one was mail-technically okay (probably), the patch contained apparent whitespace changes and trailing whitespace in the new code... Moritz ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] nvenc.c Fix H264 and HEVC vui info update
Yes. That's stange, let me try again On 2016/3/4 14:50, Timothy Gu wrote: On Fri, Mar 04, 2016 at 12:45:47PM +0800, Agatha Hu wrote: --- libavcodec/nvenc.c | 33 - 1 file changed, 28 insertions(+), 5 deletions(-) This patched is corrupted by your mail client. What's wrong with the first patch you sent (with git-send-email)? Timothy ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] nvenc.c Fix H264 and HEVC vui info update
On Fri, Mar 04, 2016 at 12:45:47PM +0800, Agatha Hu wrote: > --- > libavcodec/nvenc.c | 33 - > 1 file changed, 28 insertions(+), 5 deletions(-) This patched is corrupted by your mail client. What's wrong with the first patch you sent (with git-send-email)? Timothy ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] nvenc.c Fix H264 and HEVC vui info update
--- libavcodec/nvenc.c | 33 - 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index a3b02fa..5694f17 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -867,15 +867,22 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx) } switch (avctx->codec->id) { -case AV_CODEC_ID_H264: - ctx->encode_config.encodeCodecConfig.h264Config.h264VUIParameters.colourDescriptionPresentFlag = 1; - ctx->encode_config.encodeCodecConfig.h264Config.h264VUIParameters.videoSignalTypePresentFlag = 1; - +case AV_CODEC_ID_H264: ctx->encode_config.encodeCodecConfig.h264Config.h264VUIParameters.colourMatrix = avctx->colorspace; ctx->encode_config.encodeCodecConfig.h264Config.h264VUIParameters.colourPrimaries = avctx->color_primaries; ctx->encode_config.encodeCodecConfig.h264Config.h264VUIParameters.transferCharacteristics = avctx->color_trc; + ctx->encode_config.encodeCodecConfig.h264Config.h264VUIParameters.videoFullRangeFlag = +(avctx->color_range == AVCOL_RANGE_JPEG || avctx->pix_fmt == AV_PIX_FMT_YUVJ420P || +avctx->pix_fmt == AV_PIX_FMT_YUVJ422P || avctx->pix_fmt == AV_PIX_FMT_YUVJ444P); + ctx->encode_config.encodeCodecConfig.h264Config.h264VUIParameters.videoFormat = 5; // 5=unspecified - ctx->encode_config.encodeCodecConfig.h264Config.h264VUIParameters.videoFullRangeFlag = avctx->color_range == AVCOL_RANGE_JPEG; + ctx->encode_config.encodeCodecConfig.h264Config.h264VUIParameters.colourDescriptionPresentFlag = + (avctx->colorspace != 2 || avctx->color_primaries != 2 || avctx->color_trc != 2); + + ctx->encode_config.encodeCodecConfig.h264Config.h264VUIParameters.videoSignalTypePresentFlag = + (ctx->encode_config.encodeCodecConfig.h264Config.h264VUIParameters.colourDescriptionPresentFlag + || ctx->encode_config.encodeCodecConfig.h264Config.h264VUIParameters.videoFormat != 5 + || ctx->encode_config.encodeCodecConfig.h264Config.h264VUIParameters.videoFullRangeFlag != 0); ctx->encode_config.encodeCodecConfig.h264Config.sliceMode = 3; ctx->encode_config.encodeCodecConfig.h264Config.sliceModeData = 1; @@ -944,6 +951,22 @@ static av_cold int nvenc_encode_init(AVCodecContext *avctx) break; case AV_CODEC_ID_H265: + ctx->encode_config.encodeCodecConfig.hevcConfig.hevcVUIParameters.colourMatrix = avctx->colorspace; + ctx->encode_config.encodeCodecConfig.hevcConfig.hevcVUIParameters.colourPrimaries = avctx->color_primaries; + ctx->encode_config.encodeCodecConfig.hevcConfig.hevcVUIParameters.transferCharacteristics = avctx->color_trc; + ctx->encode_config.encodeCodecConfig.hevcConfig.hevcVUIParameters.videoFullRangeFlag = +(avctx->color_range == AVCOL_RANGE_JPEG || avctx->pix_fmt == AV_PIX_FMT_YUVJ420P || +avctx->pix_fmt == AV_PIX_FMT_YUVJ422P || avctx->pix_fmt == AV_PIX_FMT_YUVJ444P); + ctx->encode_config.encodeCodecConfig.hevcConfig.hevcVUIParameters.videoFormat = 5; // 5=unspecified + + ctx->encode_config.encodeCodecConfig.hevcConfig.hevcVUIParameters.colourDescriptionPresentFlag = + (avctx->colorspace != 2 || avctx->color_primaries != 2 || avctx->color_trc != 2); + + ctx->encode_config.encodeCodecConfig.hevcConfig.hevcVUIParameters.videoSignalTypePresentFlag = + (ctx->encode_config.encodeCodecConfig.hevcConfig.hevcVUIParameters.colourDescriptionPresentFlag + || ctx->encode_config.encodeCodecConfig.hevcConfig.hevcVUIParameters.videoFormat != 5 + || ctx->encode_config.encodeCodecConfig.hevcConfig.hevcVUIParameters.videoFullRangeFlag != 0); + ctx->encode_config.encodeCodecConfig.hevcConfig.sliceMode = 3; ctx->encode_config.encodeCodecConfig.hevcConfig.sliceModeData = 1; -- 1.9.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel