[FFmpeg-devel,23/29] avcodec/nvenc: remove YUVJ pixel formats usage

Submitted by Paul B Mahol on Dec. 10, 2017, 1:14 p.m.

Details

Message ID 20171210131436.15791-23-onemda@gmail.com
State New
Headers show

Commit Message

Paul B Mahol Dec. 10, 2017, 1:14 p.m.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/nvenc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Philip Langdale Dec. 11, 2017, 2:27 a.m.
On Sun, 10 Dec 2017 14:14:30 +0100
Paul B Mahol <onemda@gmail.com> wrote:

> Signed-off-by: Paul B Mahol <onemda@gmail.com>
> ---
>  libavcodec/nvenc.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
> index 4a91d99720..6ef51adaf0 100644
> --- a/libavcodec/nvenc.c
> +++ b/libavcodec/nvenc.c
> @@ -911,8 +911,7 @@ static av_cold int
> nvenc_setup_h264_config(AVCodecContext *avctx) vui->colourMatrix =
> avctx->colorspace; vui->colourPrimaries = avctx->color_primaries;
>      vui->transferCharacteristics = avctx->color_trc;
> -    vui->videoFullRangeFlag = (avctx->color_range == AVCOL_RANGE_JPEG
> -        || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ420P ||
> ctx->data_pix_fmt == AV_PIX_FMT_YUVJ422P || ctx->data_pix_fmt ==
> AV_PIX_FMT_YUVJ444P);
> +    vui->videoFullRangeFlag = avctx->color_range == AVCOL_RANGE_JPEG;
>  
>      vui->colourDescriptionPresentFlag =
>          (avctx->colorspace != 2 || avctx->color_primaries != 2 ||
> avctx->color_trc != 2); @@ -999,8 +998,7 @@ static av_cold int
> nvenc_setup_hevc_config(AVCodecContext *avctx) vui->colourMatrix =
> avctx->colorspace; vui->colourPrimaries = avctx->color_primaries;
>      vui->transferCharacteristics = avctx->color_trc;
> -    vui->videoFullRangeFlag = (avctx->color_range == AVCOL_RANGE_JPEG
> -        || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ420P ||
> ctx->data_pix_fmt == AV_PIX_FMT_YUVJ422P || ctx->data_pix_fmt ==
> AV_PIX_FMT_YUVJ444P);
> +    vui->videoFullRangeFlag = avctx->color_range == AVCOL_RANGE_JPEG;
>  
>      vui->colourDescriptionPresentFlag =
>          (avctx->colorspace != 2 || avctx->color_primaries != 2 ||
> avctx->color_trc != 2);

Looks fine.

--phil

Patch hide | download patch | download mbox

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 4a91d99720..6ef51adaf0 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -911,8 +911,7 @@  static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
     vui->colourMatrix = avctx->colorspace;
     vui->colourPrimaries = avctx->color_primaries;
     vui->transferCharacteristics = avctx->color_trc;
-    vui->videoFullRangeFlag = (avctx->color_range == AVCOL_RANGE_JPEG
-        || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ420P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ422P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ444P);
+    vui->videoFullRangeFlag = avctx->color_range == AVCOL_RANGE_JPEG;
 
     vui->colourDescriptionPresentFlag =
         (avctx->colorspace != 2 || avctx->color_primaries != 2 || avctx->color_trc != 2);
@@ -999,8 +998,7 @@  static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
     vui->colourMatrix = avctx->colorspace;
     vui->colourPrimaries = avctx->color_primaries;
     vui->transferCharacteristics = avctx->color_trc;
-    vui->videoFullRangeFlag = (avctx->color_range == AVCOL_RANGE_JPEG
-        || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ420P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ422P || ctx->data_pix_fmt == AV_PIX_FMT_YUVJ444P);
+    vui->videoFullRangeFlag = avctx->color_range == AVCOL_RANGE_JPEG;
 
     vui->colourDescriptionPresentFlag =
         (avctx->colorspace != 2 || avctx->color_primaries != 2 || avctx->color_trc != 2);