On Mon, Jul 17, 2017 at 04:40:38PM +0800, Huang, Zhengxu wrote:
> 

> From 45be66259e8fb99b05796748ead308f0fc73c68c Mon Sep 17 00:00:00 2001
> From: "Huang, Zhengxu" <zhengxu.maxw...@gmail.com>
> Date: Tue, 18 Jul 2017 01:13:24 +0800
> Subject: [PATCH] libavcodec/mjpeg_qsv: Add the QSV MJPEG encoder
> 
> usage:
> -hwaccel qsv -c:v h264_qsv -i in -c:v mjpeg_qsv -quality 80 -f mjpeg out
> 
> Signed-off-by: ChaoX A Liu <chaox.a....@gmail.com>
> Signed-off-by: Huang, Zhengxu <zhengxu.maxw...@gmail.com>
> Signed-off-by: Andrew, Zhang <huazh...@gmail.com>

Looks like first name and last name are reversed here.

>  configure                |  2 ++
>  libavcodec/Makefile      |  1 +
>  libavcodec/allcodecs.c   |  1 +
>  libavcodec/qsv.c         |  3 ++
>  libavcodec/qsvenc.c      | 14 ++++++++
>  libavcodec/qsvenc.h      |  3 ++
>  libavcodec/qsvenc_jpeg.c | 93 
> ++++++++++++++++++++++++++++++++++++++++++++++++
>  7 files changed, 117 insertions(+)
>  create mode 100644 libavcodec/qsvenc_jpeg.c

Please add a changelog entry.

> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -272,6 +272,7 @@ OBJS-$(CONFIG_H264_NVENC_ENCODER)      += nvenc_h264.o
>  OBJS-$(CONFIG_H264_OMX_ENCODER)        += omx.o
>  OBJS-$(CONFIG_H264_QSV_DECODER)        += qsvdec_h2645.o
>  OBJS-$(CONFIG_H264_QSV_ENCODER)        += qsvenc_h264.o
> +OBJS-$(CONFIG_MJPEG_QSV_ENCODER)       += qsvenc_jpeg.o
>  OBJS-$(CONFIG_H264_VAAPI_ENCODER)      += vaapi_encode_h264.o 
> vaapi_encode_h26x.o
>  OBJS-$(CONFIG_HAP_DECODER)             += hapdec.o hap.o
>  OBJS-$(CONFIG_HAP_ENCODER)             += hapenc.o hap.o

This list was previously in alphabetic order.

> --- a/libavcodec/qsvenc.c
> +++ b/libavcodec/qsvenc.c
> @@ -435,6 +435,15 @@ static int init_video_param(AVCodecContext *avctx, 
> QSVEncContext *q)
>  
> +    if (AV_CODEC_ID_MJPEG == avctx->codec_id) {

We usually reverse the order of comparison.

> +        av_log(avctx, AV_LOG_DEBUG, " Init codec is QSV JPEG encode \n");

This log message feels superfluous even in debug mode.

> @@ -623,6 +632,11 @@ static int qsv_retrieve_enc_params(AVCodecContext 
> *avctx, QSVEncContext *q)
>  
>      q->packet_size = q->param.mfx.BufferSizeInKB * 1000;
>  
> +    // for qsv mjpeg the return value maybe 0 so alloc the buffer
> +    if (0 == q->packet_size) {
> +        q->packet_size = q->param.mfx.FrameInfo.Height * 
> q->param.mfx.FrameInfo.Width * 4;
> +    }

Same comment about comparison order and please drop the {}.

> --- a/libavcodec/qsvenc.h
> +++ b/libavcodec/qsvenc.h
> @@ -132,6 +132,9 @@ typedef struct QSVEncContext {
>  
> +    // options for MJPEG
> +    unsigned short quality;

short looks like an odd type to use here, why?

Diego
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to