diff --git a/common/macroblock.h b/common/macroblock.h index bc78a6e..874e737 100644 --- a/common/macroblock.h +++ b/common/macroblock.h @@ -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, diff --git a/encoder/macroblock.c b/encoder/macroblock.c index 788a8ea..488d020 100644 --- a/encoder/macroblock.c +++ b/encoder/macroblock.c @@ -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 );