From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Subject: [FFmpeg-devel] [PATCH 2/6] avfilter/qp_table: Stop using FF_QSCALE_TYPE_* Date: Tue, 22 Mar 2022 13:34:29 +0100 Message-ID: <AS1PR01MB956484F2B21615CF32D504908F179@AS1PR01MB9564.eurprd01.prod.exchangelabs.com> (raw) In-Reply-To: <AS1PR01MB9564FC7E4DFDD8D054CA4DDC8F179@AS1PR01MB9564.eurprd01.prod.exchangelabs.com> All FF_QSCALE_TYPE values used by libavfilter originate from libavfilter (namely from ff_qp_table_extract()); no value is exchanged between libavcodec and libavutil. The values that are exchanged (and used in libavfilter) are of type enum AVVideoEncParamsType. Therefore this patch stops using said FF_QSCALE_TYPE_* in libavfilter and uses enum AVVideoEncParamsType directly. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavfilter/qp_table.c | 7 ++----- libavfilter/qp_table.h | 11 ++++++----- libavfilter/vf_codecview.c | 3 ++- libavfilter/vf_fspp.h | 3 ++- libavfilter/vf_pp7.h | 3 ++- libavfilter/vf_spp.h | 3 ++- libavfilter/vf_uspp.c | 3 ++- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/libavfilter/qp_table.c b/libavfilter/qp_table.c index 33812b708d..8137dc019f 100644 --- a/libavfilter/qp_table.c +++ b/libavfilter/qp_table.c @@ -18,9 +18,6 @@ #include <stdint.h> -// for FF_QSCALE_TYPE_* -#include "libavcodec/internal.h" - #include "libavutil/frame.h" #include "libavutil/mem.h" #include "libavutil/video_enc_params.h" @@ -28,7 +25,7 @@ #include "qp_table.h" int ff_qp_table_extract(AVFrame *frame, int8_t **table, int *table_w, int *table_h, - int *qscale_type) + enum AVVideoEncParamsType *qscale_type) { AVFrameSideData *sd; AVVideoEncParams *par; @@ -55,7 +52,7 @@ int ff_qp_table_extract(AVFrame *frame, int8_t **table, int *table_w, int *table if (table_h) *table_h = mb_h; if (qscale_type) - *qscale_type = FF_QSCALE_TYPE_MPEG2; + *qscale_type = par->type; if (par->nb_blocks == 0) { memset(*table, par->qp, nb_mb); diff --git a/libavfilter/qp_table.h b/libavfilter/qp_table.h index 169a7a7fea..4407bacb0e 100644 --- a/libavfilter/qp_table.h +++ b/libavfilter/qp_table.h @@ -22,23 +22,24 @@ #include <stdint.h> #include "libavutil/frame.h" -#include "libavcodec/internal.h" +#include "libavutil/video_enc_params.h" /** * Extract a libpostproc-compatible QP table - an 8-bit QP value per 16x16 * macroblock, stored in raster order - from AVVideoEncParams side data. */ int ff_qp_table_extract(AVFrame *frame, int8_t **table, int *table_w, int *table_h, - int *qscale_type); + enum AVVideoEncParamsType *qscale_type); /** * Normalize the qscale factor + * FIXME Add support for other values of enum AVVideoEncParamsType + * besides AV_VIDEO_ENC_PARAMS_MPEG2. */ -static inline int ff_norm_qscale(int qscale, int type) +static inline int ff_norm_qscale(int qscale, enum AVVideoEncParamsType type) { switch (type) { - case FF_QSCALE_TYPE_MPEG1: return qscale; - case FF_QSCALE_TYPE_MPEG2: return qscale >> 1; + case AV_VIDEO_ENC_PARAMS_MPEG2: return qscale >> 1; } return qscale; } diff --git a/libavfilter/vf_codecview.c b/libavfilter/vf_codecview.c index aac038edef..cddb3e5368 100644 --- a/libavfilter/vf_codecview.c +++ b/libavfilter/vf_codecview.c @@ -227,7 +227,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) AVFilterLink *outlink = ctx->outputs[0]; if (s->qp) { - int qstride, qp_type, ret; + enum AVVideoEncParamsType qp_type; + int qstride, ret; int8_t *qp_table; ret = ff_qp_table_extract(frame, &qp_table, &qstride, NULL, &qp_type); diff --git a/libavfilter/vf_fspp.h b/libavfilter/vf_fspp.h index 6623af450c..ee7de3ffef 100644 --- a/libavfilter/vf_fspp.h +++ b/libavfilter/vf_fspp.h @@ -23,6 +23,7 @@ #ifndef AVFILTER_FSPP_H #define AVFILTER_FSPP_H +#include "libavutil/video_enc_params.h" #include "avfilter.h" #define BLOCKSZ 12 @@ -61,7 +62,7 @@ typedef struct FSPPContext { int vsub; int temp_stride; int qp; - int qscale_type; + enum AVVideoEncParamsType qscale_type; int prev_q; uint8_t *src; int16_t *temp; diff --git a/libavfilter/vf_pp7.h b/libavfilter/vf_pp7.h index 9aa8d732c1..b7cbb020bb 100644 --- a/libavfilter/vf_pp7.h +++ b/libavfilter/vf_pp7.h @@ -22,6 +22,7 @@ #ifndef AVFILTER_PP7_H #define AVFILTER_PP7_H +#include "libavutil/video_enc_params.h" #include "avfilter.h" typedef struct PP7Context { @@ -30,7 +31,7 @@ typedef struct PP7Context { int qp; int mode; - int qscale_type; + enum AVVideoEncParamsType qscale_type; int hsub; int vsub; int temp_stride; diff --git a/libavfilter/vf_spp.h b/libavfilter/vf_spp.h index 76c0c34ab2..0a8b2b512e 100644 --- a/libavfilter/vf_spp.h +++ b/libavfilter/vf_spp.h @@ -22,6 +22,7 @@ #ifndef AVFILTER_SPP_H #define AVFILTER_SPP_H +#include "libavutil/video_enc_params.h" #include "libavcodec/avdct.h" #include "avfilter.h" @@ -33,7 +34,7 @@ typedef struct SPPContext { int log2_count; int qp; int mode; - int qscale_type; + enum AVVideoEncParamsType qscale_type; int temp_linesize; uint8_t *src; uint16_t *temp; diff --git a/libavfilter/vf_uspp.c b/libavfilter/vf_uspp.c index c61a2a0705..051de00771 100644 --- a/libavfilter/vf_uspp.c +++ b/libavfilter/vf_uspp.c @@ -32,6 +32,7 @@ #include "libavutil/mem_internal.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" +#include "libavutil/video_enc_params.h" #include "libavcodec/avcodec.h" #include "internal.h" #include "qp_table.h" @@ -45,7 +46,7 @@ typedef struct USPPContext { int log2_count; int hsub, vsub; int qp; - int qscale_type; + enum AVVideoEncParamsType qscale_type; int temp_stride[3]; uint8_t *src[3]; uint16_t *temp[3]; -- 2.32.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2022-03-22 12:34 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-03-22 12:32 [FFmpeg-devel] [PATCH 1/6] avcodec/internal, avfilter/qp_table: Remove unused FF_QSCALE_TYPEs Andreas Rheinhardt 2022-03-22 12:34 ` Andreas Rheinhardt [this message] [not found] ` <20220322123433.368717-1-andreas.rheinhardt@outlook.com> 2022-03-22 12:34 ` [FFmpeg-devel] [PATCH 3/6] avcodec/internal: Move FF_QSCALE_TYPE_* to mpegvideodec.h Andreas Rheinhardt 2022-03-22 12:35 ` [FFmpeg-devel] [PATCH 4/6] avfilter/vf_vpp_qsv: Remove unnecessary lavc and lavf headers Andreas Rheinhardt 2022-03-22 12:35 ` [FFmpeg-devel] [PATCH 5/6] avcodec, avformat: Remove unnecessary inclusions of lavc/internal.h Andreas Rheinhardt 2022-03-22 12:35 ` [FFmpeg-devel] [PATCH 6/6] avformat: Remove unnecessary inclusions from libavcodec Andreas Rheinhardt 2022-03-23 12:04 ` [FFmpeg-devel] [PATCH 1/6] avcodec/internal, avfilter/qp_table: Remove unused FF_QSCALE_TYPEs Andreas Rheinhardt
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=AS1PR01MB956484F2B21615CF32D504908F179@AS1PR01MB9564.eurprd01.prod.exchangelabs.com \ --to=andreas.rheinhardt@outlook.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git