在 T264 中对 I 帧 的 色度信息 进行编码时,具体地说是在进行模式选择时,存在着两种模式不匹配的问题.
static void
T264_intra_8x8_available(T264_t* t, int32_t preds[], int32_t* modes,
uint8_t* top_u, uint8_t* left_u, uint8_t* top_v, uint8_t* left_v)
{
int32_t i;
uint8_t* p_u, *p_v;
if ((t->mb->mb_neighbour & (MB_LEFT | MB_TOP)) == (MB_LEFT | MB_TOP))
{
preds[0] = Intra_8x8_DC; // 0
preds[1] = Intra_8x8_TOP; // 2
preds[2] = Intra_8x8_LEFT; // 1
preds[3] = Intra_8x8_PLANE; // 3
};
.............................................................
}
void
T264_mode_decision_intra_uv(_RW T264_t* t)
{
.............................................................
static const uint8_t fixmode_8x8[] =
{
Intra_8x8_DC, // 0
Intra_8x8_LEFT, // 1
Intra_8x8_TOP, // 2
Intra_8x8_PLANE, // 3
Intra_8x8_DC, // 0
Intra_8x8_DC, // 0
Intra_8x8_DC // 0
};
.......................................................
}
应该将 T264_intra_8x8_available() 改正如下:
static void
T264_intra_8x8_available(T264_t* t, int32_t preds[], int32_t* modes,
uint8_t* top_u, uint8_t* left_u, uint8_t* top_v, uint8_t* left_v)
{
int32_t i;
uint8_t* p_u, *p_v;
if ((t->mb->mb_neighbour & (MB_LEFT | MB_TOP)) == (MB_LEFT | MB_TOP))
{
/*
preds[0] = Intra_8x8_DC; // 0
preds[1] = Intra_8x8_TOP; // 2
preds[2] = Intra_8x8_LEFT; // 1
preds[3] = Intra_8x8_PLANE; // 3
*/
// quanming1119 2006.2.16
preds[0] = Intra_8x8_DC; // 0
preds[1] = Intra_8x8_LEFT; // 1
preds[2] = Intra_8x8_TOP; // 2
preds[3] = Intra_8x8_PLANE; // 3