mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 11:24:05 +00:00
Added predInfo coding comments and a template for future use
This commit is contained in:
parent
eba43088b2
commit
cecbd1585b
|
@ -272,6 +272,7 @@ void encode_one_frame(encoder_control* encoder)
|
||||||
}
|
}
|
||||||
else if(encoder->frame < 10)
|
else if(encoder->frame < 10)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
cabac_start(&cabac);
|
cabac_start(&cabac);
|
||||||
encoder->in.cur_pic.type = 0;
|
encoder->in.cur_pic.type = 0;
|
||||||
encode_slice_header(encoder);
|
encode_slice_header(encoder);
|
||||||
|
@ -282,6 +283,7 @@ void encode_one_frame(encoder_control* encoder)
|
||||||
bitstream_flush(encoder->stream);
|
bitstream_flush(encoder->stream);
|
||||||
nal_write(encoder->output, encoder->stream->buffer, encoder->stream->buffer_pos, 0, 0, encoder->frame);
|
nal_write(encoder->output, encoder->stream->buffer, encoder->stream->buffer_pos, 0, 0, encoder->frame);
|
||||||
bitstream_clear_buffer(encoder->stream);
|
bitstream_clear_buffer(encoder->stream);
|
||||||
|
*/
|
||||||
/*
|
/*
|
||||||
encoder->in.cur_pic.type = 0;
|
encoder->in.cur_pic.type = 0;
|
||||||
encode_slice_header(encoder);
|
encode_slice_header(encoder);
|
||||||
|
@ -683,7 +685,7 @@ void encode_coding_tree(encoder_control* encoder,uint16_t xCtb,uint16_t yCtb, ui
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(/*border_x && border_y)//*/yCtb == 20 && (xCtb >= 20 && xCtb <= 40))
|
if(/*border_x && border_y)//*/(yCtb >= 10 && yCtb <= 20) && (xCtb >= 20 && xCtb <= 60))
|
||||||
{
|
{
|
||||||
cur_CU->type = CU_INTRA;
|
cur_CU->type = CU_INTRA;
|
||||||
}
|
}
|
||||||
|
@ -750,26 +752,54 @@ void encode_coding_tree(encoder_control* encoder,uint16_t xCtb,uint16_t yCtb, ui
|
||||||
else if(cur_CU->type == CU_INTRA)
|
else if(cur_CU->type == CU_INTRA)
|
||||||
{
|
{
|
||||||
static int predMode = 0;
|
static int predMode = 0;
|
||||||
|
uint8_t intraPredMode = 10;
|
||||||
|
uint8_t intraPredModeChroma = 36; //Chroma derived from luma
|
||||||
cabac_encodeBinTrm(&cabac, 0); /* IPCMFlag == 0 */
|
cabac_encodeBinTrm(&cabac, 0); /* IPCMFlag == 0 */
|
||||||
|
|
||||||
cabac.ctx = &g_IntraModeSCModel;
|
|
||||||
CABAC_BIN(&cabac,0,"IntraPred");
|
|
||||||
|
|
||||||
/*
|
|
||||||
Int preds[3] = {-1, -1, -1};
|
|
||||||
Int predNum = pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds);
|
|
||||||
*/
|
|
||||||
CABAC_BINS_EP(&cabac, 10, 5, "intraPredMode");
|
|
||||||
//predMode++;
|
|
||||||
//predMode = predMode % 10;
|
|
||||||
|
|
||||||
if(encoder->in.video_format != FORMAT_400)
|
/*
|
||||||
{
|
PREDINFO CODING
|
||||||
cabac.ctx = &g_ChromaPredSCModel[0];
|
If intra prediction mode is found from the predictors,
|
||||||
CABAC_BIN(&cabac,1,"IntraPredChroma");
|
it can be signaled with two EP's. Otherwise we can send
|
||||||
|
5 EP bins with the full predmode
|
||||||
|
Int preds[3] = {-1, -1, -1};
|
||||||
|
Int predNum = pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds);
|
||||||
|
*/
|
||||||
|
//ToDo: apply predictors
|
||||||
|
// mpmPred[part] == is_in_predictors(preds);
|
||||||
|
//For each part {
|
||||||
|
cabac.ctx = &g_IntraModeSCModel;
|
||||||
|
CABAC_BIN(&cabac,0/*mpmPred[part]*/,"IntraPred");
|
||||||
|
//} End for each part
|
||||||
|
|
||||||
CABAC_BINS_EP(&cabac, 1, 2, "intraPredModeChroma");
|
/*Skeleton structure for intrapredmode signaling */
|
||||||
}
|
//For each part {
|
||||||
|
//IF mpmPred[part] { //If found from predictors, we can simplify signaling
|
||||||
|
// intraPredMode = mpmPred[part];
|
||||||
|
// CABAC_BIN_EP(&cabac, (intraPredMode==0)?0:1, "intraPredMode");
|
||||||
|
// if(intraPredMode!=0)
|
||||||
|
// CABAC_BIN_EP(&cabac, (intraPredMode==1)?0:1, "intraPredMode");
|
||||||
|
// } else { //Else we signal the full predmode
|
||||||
|
CABAC_BINS_EP(&cabac, intraPredMode, 5, "intraPredMode");
|
||||||
|
//predMode++;
|
||||||
|
//predMode = predMode % 10;
|
||||||
|
//}
|
||||||
|
//} End for each part
|
||||||
|
|
||||||
|
|
||||||
|
if(encoder->in.video_format != FORMAT_400)
|
||||||
|
{
|
||||||
|
cabac.ctx = &g_ChromaPredSCModel[0];
|
||||||
|
CABAC_BIN(&cabac,((intraPredModeChroma!=36)?1:0),"IntraPredChroma");
|
||||||
|
if(intraPredModeChroma!=36)
|
||||||
|
{
|
||||||
|
//ToDo: allowedChromaDir
|
||||||
|
CABAC_BINS_EP(&cabac, intraPredModeChroma, 2, "intraPredModeChroma");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
END OF PREDINFO CODING
|
||||||
|
*/
|
||||||
|
|
||||||
/* Coeff */
|
/* Coeff */
|
||||||
/* Transform tree */
|
/* Transform tree */
|
||||||
|
@ -784,7 +814,7 @@ void encode_coding_tree(encoder_control* encoder,uint16_t xCtb,uint16_t yCtb, ui
|
||||||
/*
|
/*
|
||||||
Quant and transform here...
|
Quant and transform here...
|
||||||
*/
|
*/
|
||||||
//CbY = 1; /* Let's pretend we have luma coefficients */
|
CbY = 1; /* Let's pretend we have luma coefficients */
|
||||||
|
|
||||||
/* Signal if chroma data is present */
|
/* Signal if chroma data is present */
|
||||||
if(encoder->in.video_format != FORMAT_400)
|
if(encoder->in.video_format != FORMAT_400)
|
||||||
|
@ -903,6 +933,9 @@ void encode_coding_tree(encoder_control* encoder,uint16_t xCtb,uint16_t yCtb, ui
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Code last_coeff_x and last_coeff_y */
|
/* Code last_coeff_x and last_coeff_y */
|
||||||
|
#ifdef _DEBUG
|
||||||
|
printf("lastSignificantXY: %i, %i\r\n",last_coeff_x,last_coeff_y);
|
||||||
|
#endif
|
||||||
encode_lastSignificantXY(encoder,last_coeff_x, last_coeff_y, width, width, type, 0);
|
encode_lastSignificantXY(encoder,last_coeff_x, last_coeff_y, width, width, type, 0);
|
||||||
|
|
||||||
iScanPosSig = scanPosLast;
|
iScanPosSig = scanPosLast;
|
||||||
|
|
|
@ -416,20 +416,26 @@ void transform2d(int16_t *block,int16_t *coeff, int8_t blockSize, int8_t uiMode)
|
||||||
|
|
||||||
}
|
}
|
||||||
else*/
|
else*/
|
||||||
if(blockSize == 8)
|
switch(blockSize)
|
||||||
{
|
{
|
||||||
partialButterfly8( block, tmp, shift_1st, blockSize );
|
case 8:
|
||||||
partialButterfly8( tmp, coeff, shift_2nd, blockSize );
|
{
|
||||||
}
|
partialButterfly8( block, tmp, shift_1st, blockSize );
|
||||||
else if(blockSize == 16)
|
partialButterfly8( tmp, coeff, shift_2nd, blockSize );
|
||||||
{
|
break;
|
||||||
partialButterfly16( block, tmp, shift_1st, blockSize );
|
}
|
||||||
partialButterfly16( tmp, coeff, shift_2nd, blockSize );
|
case 16:
|
||||||
}
|
{
|
||||||
else if(blockSize == 32)
|
partialButterfly16( block, tmp, shift_1st, blockSize );
|
||||||
{
|
partialButterfly16( tmp, coeff, shift_2nd, blockSize );
|
||||||
partialButterfly32( block, tmp, shift_1st, blockSize );
|
break;
|
||||||
partialButterfly32( tmp, coeff, shift_2nd, blockSize );
|
}
|
||||||
|
case 32:
|
||||||
|
{
|
||||||
|
partialButterfly32( block, tmp, shift_1st, blockSize );
|
||||||
|
partialButterfly32( tmp, coeff, shift_2nd, blockSize );
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue