Skip to content

Commit 9c4599a

Browse files
youennfphiln
authored andcommitted
Cherry-pick aom 3154860bdbe978da9271ba55eea60973b0be06b5
https://bugs.webkit.org/show_bug.cgi?id=253015 rdar://105507028 Reviewed by Geoffrey Garen. Cherry-pick patch from upstream. * Source/ThirdParty/libwebrtc/Source/third_party/libaom/source/libaom/av1/encoder/encodeframe_utils.c: (av1_source_content_sb): Cherry-pick: 259548.317@safari-7615-branch (92bb5fbd72e5). rdar://107755462 Canonical link: https://commits.webkit.org/262739@main
1 parent 8af3589 commit 9c4599a

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

  • Source/ThirdParty/libwebrtc/Source/third_party/libaom/source/libaom/av1/encoder

Source/ThirdParty/libwebrtc/Source/third_party/libaom/source/libaom/av1/encoder/encodeframe_utils.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,10 +1317,11 @@ void av1_source_content_sb(AV1_COMP *cpi, MACROBLOCK *x, int mi_row,
13171317
unsigned int tmp_variance;
13181318
const BLOCK_SIZE bsize = cpi->common.seq_params->sb_size;
13191319
uint8_t *src_y = cpi->source->y_buffer;
1320-
int src_ystride = cpi->source->y_stride;
1320+
const int src_ystride = cpi->source->y_stride;
1321+
const int src_offset = src_ystride * (mi_row << 2) + (mi_col << 2);
13211322
uint8_t *last_src_y = cpi->last_source->y_buffer;
1322-
int last_src_ystride = cpi->last_source->y_stride;
1323-
const int offset = cpi->source->y_stride * (mi_row << 2) + (mi_col << 2);
1323+
const int last_src_ystride = cpi->last_source->y_stride;
1324+
const int last_src_offset = last_src_ystride * (mi_row << 2) + (mi_col << 2);
13241325
uint64_t avg_source_sse_threshold[2] = { 100000, // ~5*5*(64*64)
13251326
36000 }; // ~3*3*(64*64)
13261327
uint64_t avg_source_sse_threshold_high = 1000000; // ~15*15*(64*64)
@@ -1329,8 +1330,8 @@ void av1_source_content_sb(AV1_COMP *cpi, MACROBLOCK *x, int mi_row,
13291330
MACROBLOCKD *xd = &x->e_mbd;
13301331
if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) return;
13311332
#endif
1332-
src_y += offset;
1333-
last_src_y += offset;
1333+
src_y += src_offset;
1334+
last_src_y += last_src_offset;
13341335
tmp_variance = cpi->ppi->fn_ptr[bsize].vf(src_y, src_ystride, last_src_y,
13351336
last_src_ystride, &tmp_sse);
13361337
// rd thresholds

0 commit comments

Comments
 (0)