clamp-abs-QIndex.patch 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. # HG changeset patch
  2. # User Gerald Squelart <gsquelart@mozilla.com>
  3. # Parent a2eeff55028dc78e98a16e1d8840d77378f37408
  4. Bug 1224361 - Clamp QIndex also in abs-value mode - r=rillian
  5. diff --git a/media/libvpx/vp8/decoder/decodeframe.c b/media/libvpx/vp8/decoder/decodeframe.c
  6. --- a/media/libvpx/vp8/decoder/decodeframe.c
  7. +++ b/media/libvpx/vp8/decoder/decodeframe.c
  8. @@ -66,20 +66,19 @@ void vp8_mb_init_dequantizer(VP8D_COMP *
  9. if (xd->segmentation_enabled)
  10. {
  11. /* Abs Value */
  12. if (xd->mb_segement_abs_delta == SEGMENT_ABSDATA)
  13. QIndex = xd->segment_feature_data[MB_LVL_ALT_Q][mbmi->segment_id];
  14. /* Delta Value */
  15. else
  16. - {
  17. QIndex = pc->base_qindex + xd->segment_feature_data[MB_LVL_ALT_Q][mbmi->segment_id];
  18. - QIndex = (QIndex >= 0) ? ((QIndex <= MAXQ) ? QIndex : MAXQ) : 0; /* Clamp to valid range */
  19. - }
  20. +
  21. + QIndex = (QIndex >= 0) ? ((QIndex <= MAXQ) ? QIndex : MAXQ) : 0; /* Clamp to valid range */
  22. }
  23. else
  24. QIndex = pc->base_qindex;
  25. /* Set up the macroblock dequant constants */
  26. xd->dequant_y1_dc[0] = 1;
  27. xd->dequant_y1[0] = pc->Y1dequant[QIndex][0];
  28. xd->dequant_y2[0] = pc->Y2dequant[QIndex][0];