History

avcodec/ituh263enc: Simplify AIC handling

Namely with block_index and block_wrap.

Andreas Rheinhardt committed 1 year ago

Commit 76432691 parent 950137a1 file · +7 −16Browse files

Unified · Split

libavcodec/ituh263enc.c+7−16
@@ -572,26 +572,17 @@ static void h263p_encode_umotion(PutBitContext *pb, int val) · 571 unmodified lines
572572
573573 static int h263_pred_dc(MPVEncContext *const s, int n, int16_t **dc_val_ptr)
574574 {
575− int x, y, wrap, a, c, pred_dc;
576− int16_t *dc_val;
575+ const int wrap = s->c.block_wrap[n];
576+ const int xy = s->c.block_index[n];
577+ int16_t *const dc_val = s->c.dc_val[0] + xy;
578+ int pred_dc;
577579
578580 /* find prediction */
579− if (n < 4) {
580− x = 2 * s->c.mb_x + (n & 1);
581− y = 2 * s->c.mb_y + ((n & 2) >> 1);
582− wrap = s->c.b8_stride;
583− dc_val = s->c.dc_val[0];
584− } else {
585− x = s->c.mb_x;
586− y = s->c.mb_y;
587− wrap = s->c.mb_stride;
588− dc_val = s->c.dc_val[n - 4 + 1];
589− }
590581 /* B C
591582 * A X
592583 */
593− a = dc_val[(x - 1) + (y) * wrap];
594− c = dc_val[(x) + (y - 1) * wrap];
584+ int a = dc_val[-1];
585+ int c = dc_val[-wrap];
595586
596587 /* No prediction outside GOB boundary */
597588 if (s->c.first_slice_line && n != 3) {
@@ -607,7 +598,7 @@ static int h263_pred_dc(MPVEncContext *const s, int n, int16_t **dc_val_ptr) · 9 unmodified lines
607598 pred_dc = c;
608599
609600 /* we assume pred is positive */
610− *dc_val_ptr = &dc_val[x + y * wrap];
601+ *dc_val_ptr = dc_val;
611602 return pred_dc;
612603 }
613604

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