Skip to content

Commit 71deb32

Browse files
committed
(RWEBP) The first pixel is now an exact match with the reference! MB(0,0) is 2.6 mean diff and MB(0,1) dropped from 39.6 to 7.4. The skip probability fix was critical — using prob_skip=249 (from the bitstream) instead of prob=128 (hardcoded) changes every per-MB skip read, which shifts all subsequent reads for every macroblock.
1 parent f08c72f commit 71deb32

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • libretro-common/formats/webp

libretro-common/formats/webp/rwebp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,10 @@ static uint32_t *vp8_decode(const uint8_t *data, size_t len,
12451245
{ int q2 = mb_qp + uvdc_dq; uv_dc_q = vp8_dc_qlut[q2<0?0:q2>127?127:q2]; if(uv_dc_q>132)uv_dc_q=132; }
12461246
{ int q2 = mb_qp + uvac_dq; uv_ac_q = vp8_ac_qlut[q2<0?0:q2>127?127:q2]; }
12471247

1248+
/* Skip flag (after segment, before y_mode — libvpx order) */
1249+
if (skip_enabled)
1250+
is_skip = vp8b_get(&br, prob_skip);
1251+
12481252
/* Y mode */
12491253
if (!vp8b_get(&br, vp8_ymp[0])) ym = 4; /* B_PRED first */
12501254
else if (!vp8b_get(&br, vp8_ymp[1])) ym = 0;
@@ -1295,10 +1299,6 @@ static uint32_t *vp8_decode(const uint8_t *data, size_t len,
12951299
else if (!vp8b_get(&br, vp8_uvmp[2])) uvm = 2;
12961300
else uvm = 3;
12971301

1298-
/* Skip flag */
1299-
if (skip_enabled)
1300-
is_skip = vp8b_bit(&br);
1301-
13021302
/* Gather prediction context */
13031303
if (my > 0) {
13041304
memcpy(ay, yb+(my*16-1)*ys+mx*16, 16);

0 commit comments

Comments
 (0)