Bug fixes, this version produces bit-perfect output

This commit is contained in:
Marko Viitanen 2013-04-18 14:37:56 +03:00
parent 58ba4b306c
commit e8f04b32f1
3 changed files with 5 additions and 4 deletions

View file

@ -1080,7 +1080,7 @@ void encode_transform_tree(encoder_control* encoder,transform_info* ti,uint8_t d
{
int16_t val = block[i++]+pred[x+y*pred_stride];
//ToDo: support 10+bits
recbase[x+y*recbase_stride] = (uint8_t)(val&0xff);//CLIP(0,255,val);
recbase[x+y*recbase_stride] = (uint8_t)/*(val&0xff);//*/CLIP(0,255,val);
}
}
/* END RECONTRUCTION */

View file

@ -567,8 +567,8 @@ void intra_getAngularPred(int16_t* pSrc, int32_t srcStride, int16_t* rpDst, int3
{
for (k=0;k<blkSize;k++)
{
pDst[k*dstStride] = (pDst[k*dstStride] + (( refSide[k+1] - refSide[0] ) >> 1)) & (1<<g_bitDepth)-1;
//CLIP(0, (1<<g_bitDepth)-1, pDst[k*dstStride] + (( refSide[k+1] - refSide[0] ) >> 1) );
pDst[k*dstStride] = //(pDst[k*dstStride] + (( refSide[k+1] - refSide[0] ) >> 1)) & (1<<g_bitDepth)-1;
CLIP(0, (1<<g_bitDepth)-1, pDst[k*dstStride] + (( refSide[k+1] - refSide[0] ) >> 1) );
}
}
}

View file

@ -122,6 +122,7 @@ void search_tree(encoder_control* encoder,uint16_t xCtb,uint16_t yCtb, uint8_t d
CU_info *cur_CU = &encoder->in.cur_pic.CU[depth][xCtb+yCtb*(encoder->in.width_in_LCU<<MAX_DEPTH)];
cur_CU->intra.cost = 0xffffffff;
cur_CU->inter.cost = 0xffffffff;
/* Force split on border */
if(depth != MAX_DEPTH)
@ -218,7 +219,7 @@ uint32_t search_best_mode(encoder_control* encoder,uint16_t xCtb,uint16_t yCtb,
CU_info *cur_CU = &encoder->in.cur_pic.CU[depth][xCtb+yCtb*(encoder->in.width_in_LCU<<MAX_DEPTH)];
uint32_t bestCost = cur_CU->intra.cost;
uint32_t cost = 0;
uint32_t lambdaCost = 4*g_lambda_cost[encoder->QP]<<8;
uint32_t lambdaCost = 4*g_lambda_cost[encoder->QP]<<5;
/* Split and search to max_depth */
if(depth != MAX_SEARCH_DEPTH)