History

avcodec/mpegvideo: Avoid {a,d}c_val[{1,2}]

These are already mostly unused; not using them here is in preparation for removing them altogether. Use block_index[4..5] instead for addressing.

Andreas Rheinhardt committed 1 year ago

Commit 32cbadc1 parent 13527b31 file · +8 −7Browse files

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

Unified · Split

libavcodec/mpegvideo.c+8−7
@@ -492,22 +492,23 @@ void ff_clean_intra_table_entries(MpegEncContext *s) · 491 unmodified lines
492492 {
493493 int wrap = s->b8_stride;
494494 int xy = s->block_index[0];
495+ /* chroma */
496+ unsigned uxy = s->block_index[4];
497+ unsigned vxy = s->block_index[5];
498+ int16_t *dc_val = s->dc_val[0];
495499
496500 s->dc_val[0][xy ] =
497501 s->dc_val[0][xy + 1 ] =
498502 s->dc_val[0][xy + wrap] =
499503 s->dc_val[0][xy + 1 + wrap] = 1024;
504+ dc_val[uxy] =
505+ dc_val[vxy] = 1024;
500506 /* ac pred */
501507 memset(s->ac_val[0][xy ], 0, 32 * sizeof(int16_t));
502508 memset(s->ac_val[0][xy + wrap], 0, 32 * sizeof(int16_t));
503− /* chroma */
504− wrap = s->mb_stride;
505− xy = s->mb_x + s->mb_y * wrap;
506− s->dc_val[1][xy] =
507− s->dc_val[2][xy] = 1024;
508509 /* ac pred */
509− memset(s->ac_val[1][xy], 0, 16 * sizeof(int16_t));
510− memset(s->ac_val[2][xy], 0, 16 * sizeof(int16_t));
510+ memset(s->ac_val[0][uxy], 0, 16 * sizeof(int16_t));
511+ memset(s->ac_val[0][vxy], 0, 16 * sizeof(int16_t));
511512 }
512513
513514 void ff_init_block_index(MpegEncContext *s){ //FIXME maybe rename

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