History

avcodec/mjpegdec: avoid indirection when accessing avctx

Marton Balint committed 2 years ago

Commit 059ea1d1 parent e6b9bfa1 file · +19 −19Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/mjpegdec.c+19−19
@@ -2422,7 +2422,7 @@ redo_for_pal8: · 2421 unmodified lines
24222422 }
24232423
24242424 s->start_code = start_code;
2425− if (s->avctx->debug & FF_DEBUG_STARTCODE)
2425+ if (avctx->debug & FF_DEBUG_STARTCODE)
24262426 av_log(avctx, AV_LOG_DEBUG, "startcode: %X\n", start_code);
24272427
24282428 /* process markers */
@@ -2486,9 +2486,9 @@ redo_for_pal8: · 57 unmodified lines
24862486 case SOF0:
24872487 case SOF1:
24882488 if (start_code == SOF0)
2489− s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT;
2489+ avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT;
24902490 else
2491− s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT;
2491+ avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT;
24922492 s->lossless = 0;
24932493 s->ls = 0;
24942494 s->progressive = 0;
@@ -2496,7 +2496,7 @@ redo_for_pal8: · 1 unmodified line
24962496 goto fail;
24972497 break;
24982498 case SOF2:
2499− s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT;
2499+ avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT;
25002500 s->lossless = 0;
25012501 s->ls = 0;
25022502 s->progressive = 1;
@@ -2504,8 +2504,8 @@ redo_for_pal8: · 1 unmodified line
25042504 goto fail;
25052505 break;
25062506 case SOF3:
2507− s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS;
2508− s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
2507+ avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS;
2508+ avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
25092509 s->lossless = 1;
25102510 s->ls = 0;
25112511 s->progressive = 0;
@@ -2513,8 +2513,8 @@ redo_for_pal8: · 1 unmodified line
25132513 goto fail;
25142514 break;
25152515 case SOF48:
2516− s->avctx->profile = AV_PROFILE_MJPEG_JPEG_LS;
2517− s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
2516+ avctx->profile = AV_PROFILE_MJPEG_JPEG_LS;
2517+ avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
25182518 s->lossless = 1;
25192519 s->ls = 1;
25202520 s->progressive = 0;
@@ -2549,8 +2549,8 @@ eoi_parser: · 28 unmodified lines
25492549 s->got_picture = 0;
25502550 goto the_end_no_picture;
25512551 }
2552− if (s->avctx->hwaccel) {
2553− ret = FF_HW_SIMPLE_CALL(s->avctx, end_frame);
2552+ if (avctx->hwaccel) {
2553+ ret = FF_HW_SIMPLE_CALL(avctx, end_frame);
25542554 if (ret < 0)
25552555 return ret;
25562556
@@ -2621,7 +2621,7 @@ fail: · 64 unmodified lines
26212621 return ret;
26222622 the_end:
26232623
2624− is16bit = av_pix_fmt_desc_get(s->avctx->pix_fmt)->comp[0].step > 1;
2624+ is16bit = av_pix_fmt_desc_get(avctx->pix_fmt)->comp[0].step > 1;
26252625
26262626 if (AV_RB32(s->upscale_h)) {
26272627 int p;
@@ -2640,7 +2640,7 @@ the_end: · 12 unmodified lines
26402640 avctx->pix_fmt == AV_PIX_FMT_GBRP ||
26412641 avctx->pix_fmt == AV_PIX_FMT_GBRAP
26422642 );
2643− ret = av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
2643+ ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &hshift, &vshift);
26442644 if (ret)
26452645 return ret;
26462646
@@ -2720,7 +2720,7 @@ the_end: · 73 unmodified lines
27202720 avctx->pix_fmt == AV_PIX_FMT_GBRP ||
27212721 avctx->pix_fmt == AV_PIX_FMT_GBRAP
27222722 );
2723− ret = av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
2723+ ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &hshift, &vshift);
27242724 if (ret)
27252725 return ret;
27262726
@@ -2750,7 +2750,7 @@ the_end: · 23 unmodified lines
27502750 }
27512751 }
27522752 if (s->flipped && !s->rgb) {
2753− ret = av_pix_fmt_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
2753+ ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &hshift, &vshift);
27542754 if (ret)
27552755 return ret;
27562756
@@ -2766,7 +2766,7 @@ the_end: · 9 unmodified lines
27662766 }
27672767 }
27682768
2769− if (s->avctx->pix_fmt == AV_PIX_FMT_GBRP) {
2769+ if (avctx->pix_fmt == AV_PIX_FMT_GBRP) {
27702770 av_assert0(s->nb_components == 3);
27712771 FFSWAP(uint8_t *, frame->data[0], frame->data[2]);
27722772 FFSWAP(uint8_t *, frame->data[0], frame->data[1]);
@@ -2774,7 +2774,7 @@ the_end: · 1 unmodified line
27742774 FFSWAP(int, frame->linesize[0], frame->linesize[1]);
27752775 }
27762776
2777− if (s->adobe_transform == 0 && s->avctx->pix_fmt == AV_PIX_FMT_GBRAP) {
2777+ if (s->adobe_transform == 0 && avctx->pix_fmt == AV_PIX_FMT_GBRAP) {
27782778 int w = s->picture_ptr->width;
27792779 int h = s->picture_ptr->height;
27802780 av_assert0(s->nb_components == 4);
@@ -2797,7 +2797,7 @@ the_end: · 16 unmodified lines
27972797 memset(dst[3], 255, w);
27982798 }
27992799 }
2800− if (s->adobe_transform == 2 && s->avctx->pix_fmt == AV_PIX_FMT_YUVA444P) {
2800+ if (s->adobe_transform == 2 && avctx->pix_fmt == AV_PIX_FMT_YUVA444P) {
28012801 int w = s->picture_ptr->width;
28022802 int h = s->picture_ptr->height;
28032803 av_assert0(s->nb_components == 4);
@@ -2842,7 +2842,7 @@ the_end: · 38 unmodified lines
28422842
28432843 sd = av_frame_new_side_data(frame, AV_FRAME_DATA_ICC_PROFILE, total_size);
28442844 if (!sd) {
2845− av_log(s->avctx, AV_LOG_ERROR, "Could not allocate frame side data\n");
2845+ av_log(avctx, AV_LOG_ERROR, "Could not allocate frame side data\n");
28462846 return AVERROR(ENOMEM);
28472847 }
28482848
@@ -2865,7 +2865,7 @@ the_end: · 16 unmodified lines
28652865
28662866 sd = av_frame_new_side_data(frame, AV_FRAME_DATA_DISPLAYMATRIX, sizeof(int32_t) * 9);
28672867 if (!sd) {
2868− av_log(s->avctx, AV_LOG_ERROR, "Could not allocate frame side data\n");
2868+ av_log(avctx, AV_LOG_ERROR, "Could not allocate frame side data\n");
28692869 return AVERROR(ENOMEM);
28702870 }
28712871

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t