Fix lossless mode borked in r901
authorBugMaster <BugMaster@narod.ru>
Wed, 16 Jul 2008 17:54:51 +0000 (11:54 -0600)
committerFiona Glaser <fiona@x264.com>
Wed, 16 Jul 2008 17:54:51 +0000 (11:54 -0600)
common/macroblock.h
encoder/macroblock.c

index a556495..57e89e4 100644 (file)
@@ -224,6 +224,10 @@ static const uint8_t block_idx_xy_1d[16] =
 {
     0, 1, 4, 5, 2, 3, 6, 7, 8, 9, 12, 13, 10, 11, 14, 15
 };
+static const uint8_t block_idx_yx_1d[16] =
+{
+    0, 4, 1, 5, 8, 12, 9, 13, 2, 6, 3, 7, 10, 14, 11, 15
+};
 static const uint8_t block_idx_xy_fenc[16] =
 {
     0*4 + 0*4*FENC_STRIDE, 1*4 + 0*4*FENC_STRIDE,
index 96c0db5..593e30c 100644 (file)
@@ -147,7 +147,7 @@ static void x264_mb_encode_i16x16( x264_t *h, int i_qscale )
             int oe = block_idx_xy_fenc[i];
             int od = block_idx_xy_fdec[i];
             h->zigzagf.sub_4x4( h->dct.luma4x4[i], p_src+oe, p_dst+od );
-            dct_dc4x4[0][block_idx_xy_1d[i]] = h->dct.luma4x4[i][0];
+            dct_dc4x4[0][block_idx_yx_1d[i]] = h->dct.luma4x4[i][0];
             h->dct.luma4x4[i][0] = 0;
         }
         h->zigzagf.scan_4x4( h->dct.luma16x16_dc, dct_dc4x4 );