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

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

Unified · Split

libavcodec/ituh263enc.c+7−16
@@ -572,26 +572,17 @@ static void h263p_encode_umotion(PutBitContext *pb, int val) · 571 unmodified lines
572 572
573static int h263_pred_dc(MPVEncContext *const s, int n, int16_t **dc_val_ptr)573static int h263_pred_dc(MPVEncContext *const s, int n, int16_t **dc_val_ptr)
574{574{
575 int x, y, wrap, a, c, pred_dc;575 const int wrap = s->c.block_wrap[n];
576 int16_t *dc_val;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;
577 579
578 /* find prediction */580 /* 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 }
590 /* B C581 /* B C
591 * A X582 * A X
592 */583 */
593 a = dc_val[(x - 1) + (y) * wrap];584 int a = dc_val[-1];
594 c = dc_val[(x) + (y - 1) * wrap];585 int c = dc_val[-wrap];
595 586
596 /* No prediction outside GOB boundary */587 /* No prediction outside GOB boundary */
597 if (s->c.first_slice_line && n != 3) {588 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
607 pred_dc = c;598 pred_dc = c;
608 599
609 /* we assume pred is positive */600 /* we assume pred is positive */
610 *dc_val_ptr = &dc_val[x + y * wrap];601 *dc_val_ptr = dc_val;
611 return pred_dc;602 return pred_dc;
612}603}
613 604

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