From: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> To: ffmpeg-devel@ffmpeg.org Cc: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Subject: [FFmpeg-devel] [PATCH 7/7] avcodec/vc2enc: Use already available AVPixFmtDescriptor Date: Tue, 28 May 2024 04:49:12 +0200 Message-ID: <AS8P250MB0744B7C99A7C95494735593E8FF12@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> (raw) In-Reply-To: <AS8P250MB07442EF03FD5DC8CB1FA9E1B8FF12@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/vc2enc.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c index e72c15e6f2..1d0754c09b 100644 --- a/libavcodec/vc2enc.c +++ b/libavcodec/vc2enc.c @@ -1026,9 +1026,9 @@ static av_cold int vc2_encode_init(AVCodecContext *avctx) { Plane *p; SubBand *b; - int i, level, o, shift, ret; - const AVPixFmtDescriptor *fmt = av_pix_fmt_desc_get(avctx->pix_fmt); - const int depth = fmt->comp[0].depth; + int i, level, o, shift; + const AVPixFmtDescriptor *pixdesc; + int depth; VC2EncContext *s = avctx->priv_data; s->picture_number = 0; @@ -1100,12 +1100,13 @@ static av_cold int vc2_encode_init(AVCodecContext *avctx) s->base_vf, base_video_fmts[s->base_vf].name); } + pixdesc = av_pix_fmt_desc_get(avctx->pix_fmt); /* Chroma subsampling */ - ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_x_shift, &s->chroma_y_shift); - if (ret) - return ret; + s->chroma_x_shift = pixdesc->log2_chroma_w; + s->chroma_y_shift = pixdesc->log2_chroma_h; /* Bit depth and color range index */ + depth = pixdesc->comp[0].depth; if (depth == 8 && avctx->color_range == AVCOL_RANGE_JPEG) { s->bpp = 1; s->bpp_idx = 1; -- 2.40.1 _______________________________________________ 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:[~2024-05-28 2:50 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-05-28 2:47 [FFmpeg-devel] [PATCH 1/7] avcodec/vc2enc: Avoid void* where possible Andreas Rheinhardt 2024-05-28 2:49 ` [FFmpeg-devel] [PATCH 2/7] avcodec/vc2enc: Constify slices->main context pointers Andreas Rheinhardt 2024-05-28 2:49 ` [FFmpeg-devel] [PATCH 3/7] avcodec/vc2enc: Remove superfluous error message Andreas Rheinhardt 2024-05-28 2:49 ` [FFmpeg-devel] [PATCH 4/7] avcodec/vc2enc: Fix slice length Andreas Rheinhardt 2024-05-28 2:49 ` [FFmpeg-devel] [PATCH 5/7] avcodec/vc2enc: Avoid relocations for short strings Andreas Rheinhardt 2024-05-28 3:07 ` James Almer 2024-05-28 6:38 ` Rémi Denis-Courmont 2024-05-28 14:25 ` Lynne via ffmpeg-devel 2024-05-28 2:49 ` [FFmpeg-devel] [PATCH 6/7] avcodec/vc2enc: Move transient PutBitContext from ctx to stack Andreas Rheinhardt 2024-05-28 2:49 ` Andreas Rheinhardt [this message] 2024-05-30 18:53 ` [FFmpeg-devel] [PATCH 1/7] avcodec/vc2enc: Avoid void* where possible 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=AS8P250MB0744B7C99A7C95494735593E8FF12@AS8P250MB0744.EURP250.PROD.OUTLOOK.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