diff --git a/src/encoder.c b/src/encoder.c index be0cd9f8..608886c2 100644 --- a/src/encoder.c +++ b/src/encoder.c @@ -730,12 +730,12 @@ void encode_coding_tree(encoder_control* encoder,uint16_t xCtb,uint16_t yCtb, ui CABAC_BIN(&cabac, (cur_CU->type == CU_INTRA)?1:0, "PredMode"); } - /* Signal PartSize on max depth */ - if(depth == MAX_DEPTH) - { - cabac.ctx = &g_PartSizeSCModel[(cur_CU->type == CU_INTRA)?0:999]; - CABAC_BIN(&cabac, 1, "PartSize"); - } + /* Signal PartSize on max depth */ + if(depth == MAX_DEPTH) + { + cabac.ctx = &g_PartSizeSCModel[(cur_CU->type == CU_INTRA)?0:999]; + CABAC_BIN(&cabac, 1, "PartSize"); + } /*end partsize*/ if(cur_CU->type == CU_INTER) @@ -1022,7 +1022,6 @@ void encode_transform_tree(encoder_control* encoder,transform_info* ti,uint8_t d ti->idx = 3; encode_transform_tree(encoder,ti,depth+1); return; } - { uint8_t CbY = 0,CbU = 0,CbV = 0; @@ -1249,7 +1248,7 @@ void encode_transform_coeff(encoder_control* encoder,transform_info* ti,int8_t d if(encoder->in.video_format != FORMAT_400) { /* Non-zero chroma U Tcoeffs */ - //ToDo: fix + //ToDo: fix transform split int8_t Cb_flag = ti->cb_top[1];//(trDepth==0&&split)?ti->cb_top[1]:(ti->cb[ti->idx]&0x2); cabac.ctx = &g_QtCbfSCModelU[trDepth]; if(trDepth == 0 || ti->cb_top[1]) @@ -1258,7 +1257,7 @@ void encode_transform_coeff(encoder_control* encoder,transform_info* ti,int8_t d } /* Non-zero chroma V Tcoeffs */ /* NOTE: Using the same ctx as before */ - //ToDo: fix + //ToDo: fix transform split Cb_flag = ti->cb_top[2];//(trDepth==0&&split)?ti->cb_top[2]:(ti->cb[ti->idx]&0x4); if(trDepth == 0 || ti->cb_top[2]) { diff --git a/src/inter.c b/src/inter.c new file mode 100644 index 00000000..d61eccdc --- /dev/null +++ b/src/inter.c @@ -0,0 +1,53 @@ +/** + * HEVC Encoder + * - Marko Viitanen ( fador at iki.fi ), Tampere University of Technology, Department of Pervasive Computing. + */ + +/*! \file inter.c + \brief Inter functions + \author Marko Viitanen + \date 2013-04 + + Inter functions +*/ + +#include +#include +#include +#include "global.h" +#include "config.h" +#include "encoder.h" +#include "picture.h" +#include "inter.h" + + +/*! + \brief Set block mode (and init typedata) + \param pic picture to use + \param xCtb x CU position (smallest CU) + \param yCtb y CU position (smallest CU) + \param depth current CU depth + \param mode mode to set + \returns Void +*/ +void inter_setBlockMode(picture* pic,uint32_t xCtb, uint32_t yCtb, uint8_t depth, uint8_t mode) +{ + uint32_t x,y,d; + /* Width in smallest CU */ + int width_in_SCU = pic->width/(LCU_WIDTH>>MAX_DEPTH); + int block_SCU_width = (LCU_WIDTH>>depth)/(LCU_WIDTH>>MAX_DEPTH); + for(y = yCtb; y < yCtb+block_SCU_width; y++) + { + int CUpos = y*width_in_SCU; + for(x = xCtb; x < xCtb+block_SCU_width; x++) + { + for(d = 0; d < MAX_DEPTH+1; d++) + { + pic->CU[d][CUpos+x].depth = depth; + pic->CU[d][CUpos+x].type = CU_INTER; + pic->CU[d][CUpos+x].inter.mode = mode; + } + } + } +} + diff --git a/src/inter.h b/src/inter.h new file mode 100644 index 00000000..f95adf58 --- /dev/null +++ b/src/inter.h @@ -0,0 +1,18 @@ +/** + * HEVC Encoder + * - Marko Viitanen ( fador at iki.fi ), Tampere University of Technology, Department of Pervasive Computing. + */ + +/*! \file inter.h + \brief Inter function headers + \author Marko Viitanen + \date 2013-04 + + Inter functions +*/ +#ifndef __INTER_H +#define __INTER_H + +void inter_setBlockMode(picture* pic,uint32_t xCtb, uint32_t yCtb, uint8_t depth, uint8_t mode); + +#endif diff --git a/src/intra.c b/src/intra.c index cdabb35c..01898d45 100644 --- a/src/intra.c +++ b/src/intra.c @@ -577,6 +577,7 @@ void intra_getAngularPred(int16_t* pSrc, int32_t srcStride, int16_t* rpDst, int3 int32_t deltaPos=0; int32_t deltaInt; int32_t deltaFract; + int32_t minusDeltaFract; int32_t refMainIndex; for (k=0;k> 5; deltaFract = deltaPos & (32 - 1); + if (deltaFract) { + minusDeltaFract = (32-deltaFract); // Do linear filtering for (l=0;l> 5 ); + pDst[k*dstStride+l] = (int16_t) ( (minusDeltaFract*refMain[refMainIndex]+deltaFract*refMain[refMainIndex+1]+16) >> 5 ); } } else