Skip to content

Commit 44c1db8

Browse files
committed
All Fixes Applied in the Output File
Key Finding from This Session The GDB range measurements at pbi+0x383c are unreliable because non-BD code writes to the same memory location during per-MB processing (like dequantizer setup). The actual BD range (kept in registers during tree walks) matches between our decoder and libvpx. The remaining bmi[7] divergence likely stems from a subtle difference in how the BD fills or normalizes that I haven't been able to isolate.
1 parent 5f5a0be commit 44c1db8

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

  • libretro-common/formats/webp

libretro-common/formats/webp/rwebp.c

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,40 @@ static void vp8_pred4x4(uint8_t *d, int s, int m,
965965
d[0*s+3]=(uint8_t)((a[2]+a[3]+1)>>1);
966966
d[1*s+3]=(uint8_t)((a[1]+2*a[2]+a[3]+2)>>2);
967967
break;
968-
default: /* B_VL, B_HD, B_HU — simplified to DC for now */
968+
case 7: /* B_VL_PRED */
969+
d[0*s+0]=(uint8_t)((a[0]+a[1]+1)>>1);
970+
d[1*s+0]=(uint8_t)((a[0]+2*a[1]+a[2]+2)>>2);
971+
d[0*s+1]=d[2*s+0]=(uint8_t)((a[1]+a[2]+1)>>1);
972+
d[1*s+1]=d[3*s+0]=(uint8_t)((a[1]+2*a[2]+a[3]+2)>>2);
973+
d[0*s+2]=d[2*s+1]=(uint8_t)((a[2]+a[3]+1)>>1);
974+
d[1*s+2]=d[3*s+1]=(uint8_t)((a[2]+2*a[3]+a[4]+2)>>2);
975+
d[0*s+3]=d[2*s+2]=(uint8_t)((a[3]+a[4]+1)>>1);
976+
d[1*s+3]=d[3*s+2]=(uint8_t)((a[3]+2*a[4]+a[5]+2)>>2);
977+
d[2*s+3]=(uint8_t)((a[4]+a[5]+1)>>1);
978+
d[3*s+3]=(uint8_t)((a[4]+2*a[5]+a[6]+2)>>2);
979+
break;
980+
case 8: /* B_HD_PRED */
981+
d[3*s+0]=(uint8_t)((l[3]+l[2]+1)>>1);
982+
d[3*s+1]=(uint8_t)((l[3]+2*l[2]+l[1]+2)>>2);
983+
d[2*s+0]=d[3*s+2]=(uint8_t)((l[2]+l[1]+1)>>1);
984+
d[2*s+1]=d[3*s+3]=(uint8_t)((l[2]+2*l[1]+l[0]+2)>>2);
985+
d[1*s+0]=d[2*s+2]=(uint8_t)((l[1]+l[0]+1)>>1);
986+
d[1*s+1]=d[2*s+3]=(uint8_t)((l[1]+2*l[0]+tl+2)>>2);
987+
d[0*s+0]=d[1*s+2]=(uint8_t)((l[0]+tl+1)>>1);
988+
d[0*s+1]=d[1*s+3]=(uint8_t)((l[0]+2*tl+a[0]+2)>>2);
989+
d[0*s+2]=(uint8_t)((tl+2*a[0]+a[1]+2)>>2);
990+
d[0*s+3]=(uint8_t)((a[0]+2*a[1]+a[2]+2)>>2);
991+
break;
992+
case 9: /* B_HU_PRED */
993+
d[0*s+0]=(uint8_t)((l[0]+l[1]+1)>>1);
994+
d[0*s+1]=(uint8_t)((l[0]+2*l[1]+l[2]+2)>>2);
995+
d[0*s+2]=d[1*s+0]=(uint8_t)((l[1]+l[2]+1)>>1);
996+
d[0*s+3]=d[1*s+1]=(uint8_t)((l[1]+2*l[2]+l[3]+2)>>2);
997+
d[1*s+2]=d[2*s+0]=(uint8_t)((l[2]+l[3]+1)>>1);
998+
d[1*s+3]=d[2*s+1]=(uint8_t)((l[2]+2*l[3]+l[3]+2)>>2);
999+
d[2*s+2]=d[2*s+3]=d[3*s+0]=d[3*s+1]=d[3*s+2]=d[3*s+3]=(uint8_t)l[3];
1000+
break;
1001+
default:
9691002
{ int sum=0;
9701003
for(i=0;i<4;i++) sum+=a[i]+l[i];
9711004
{ uint8_t dc=(uint8_t)((sum+4)>>3);

0 commit comments

Comments
 (0)