From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id B3CDA45AF5 for ; Wed, 13 Dec 2023 18:27:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0FE6768D058; Wed, 13 Dec 2023 20:27:14 +0200 (EET) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 804A468D037 for ; Wed, 13 Dec 2023 20:27:07 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 46D6AE98F8; Wed, 13 Dec 2023 19:27:07 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XrYmUTOsRdV0; Wed, 13 Dec 2023 19:27:04 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 35BE5E98EF; Wed, 13 Dec 2023 19:27:04 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Wed, 13 Dec 2023 19:26:57 +0100 Message-Id: <20231213182657.9190-2-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20231213182657.9190-1-cus@passwd.hu> References: <20231213182657.9190-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/mjpegdec: avoid indirection when accessing avctx X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Marton Balint Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: Marton Balint --- libavcodec/mjpegdec.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 8191606f43..81f724d230 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -2422,7 +2422,7 @@ redo_for_pal8: } s->start_code = start_code; - if (s->avctx->debug & FF_DEBUG_STARTCODE) + if (avctx->debug & FF_DEBUG_STARTCODE) av_log(avctx, AV_LOG_DEBUG, "startcode: %X\n", start_code); /* process markers */ @@ -2486,9 +2486,9 @@ redo_for_pal8: case SOF0: case SOF1: if (start_code == SOF0) - s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT; + avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT; else - s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT; + avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT; s->lossless = 0; s->ls = 0; s->progressive = 0; @@ -2496,7 +2496,7 @@ redo_for_pal8: goto fail; break; case SOF2: - s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT; + avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT; s->lossless = 0; s->ls = 0; s->progressive = 1; @@ -2504,8 +2504,8 @@ redo_for_pal8: goto fail; break; case SOF3: - s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS; - s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; + avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS; + avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; s->lossless = 1; s->ls = 0; s->progressive = 0; @@ -2513,8 +2513,8 @@ redo_for_pal8: goto fail; break; case SOF48: - s->avctx->profile = AV_PROFILE_MJPEG_JPEG_LS; - s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; + avctx->profile = AV_PROFILE_MJPEG_JPEG_LS; + avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; s->lossless = 1; s->ls = 1; s->progressive = 0; @@ -2549,8 +2549,8 @@ eoi_parser: s->got_picture = 0; goto the_end_no_picture; } - if (s->avctx->hwaccel) { - ret = FF_HW_SIMPLE_CALL(s->avctx, end_frame); + if (avctx->hwaccel) { + ret = FF_HW_SIMPLE_CALL(avctx, end_frame); if (ret < 0) return ret; @@ -2621,7 +2621,7 @@ fail: return ret; the_end: - is16bit = av_pix_fmt_desc_get(s->avctx->pix_fmt)->comp[0].step > 1; + is16bit = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].step > 1; if (AV_RB32(s->upscale_h)) { int p; @@ -2640,7 +2640,7 @@ the_end: avctx->pix_fmt == AV_PIX_FMT_GBRP || avctx->pix_fmt == AV_PIX_FMT_GBRAP ); - ret = av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); + ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &hshift, &vshift); if (ret) return ret; @@ -2720,7 +2720,7 @@ the_end: avctx->pix_fmt == AV_PIX_FMT_GBRP || avctx->pix_fmt == AV_PIX_FMT_GBRAP ); - ret = av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); + ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &hshift, &vshift); if (ret) return ret; @@ -2750,7 +2750,7 @@ the_end: } } if (s->flipped && !s->rgb) { - ret = av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift); + ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &hshift, &vshift); if (ret) return ret; @@ -2766,7 +2766,7 @@ the_end: } } - if (s->avctx->pix_fmt == AV_PIX_FMT_GBRP) { + if (avctx->pix_fmt == AV_PIX_FMT_GBRP) { av_assert0(s->nb_components == 3); FFSWAP(uint8_t *, frame->data[0], frame->data[2]); FFSWAP(uint8_t *, frame->data[0], frame->data[1]); @@ -2774,7 +2774,7 @@ the_end: FFSWAP(int, frame->linesize[0], frame->linesize[1]); } - if (s->adobe_transform == 0 && s->avctx->pix_fmt == AV_PIX_FMT_GBRAP) { + if (s->adobe_transform == 0 && avctx->pix_fmt == AV_PIX_FMT_GBRAP) { int w = s->picture_ptr->width; int h = s->picture_ptr->height; av_assert0(s->nb_components == 4); @@ -2797,7 +2797,7 @@ the_end: memset(dst[3], 255, w); } } - if (s->adobe_transform == 2 && s->avctx->pix_fmt == AV_PIX_FMT_YUVA444P) { + if (s->adobe_transform == 2 && avctx->pix_fmt == AV_PIX_FMT_YUVA444P) { int w = s->picture_ptr->width; int h = s->picture_ptr->height; av_assert0(s->nb_components == 4); @@ -2842,7 +2842,7 @@ the_end: sd = av_frame_new_side_data(frame, AV_FRAME_DATA_ICC_PROFILE, total_size); if (!sd) { - av_log(s->avctx, AV_LOG_ERROR, "Could not allocate frame side data\n"); + av_log(avctx, AV_LOG_ERROR, "Could not allocate frame side data\n"); return AVERROR(ENOMEM); } @@ -2865,7 +2865,7 @@ the_end: sd = av_frame_new_side_data(frame, AV_FRAME_DATA_DISPLAYMATRIX, sizeof(int32_t) * 9); if (!sd) { - av_log(s->avctx, AV_LOG_ERROR, "Could not allocate frame side data\n"); + av_log(avctx, AV_LOG_ERROR, "Could not allocate frame side data\n"); return AVERROR(ENOMEM); } -- 2.35.3 _______________________________________________ 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".