/*The function used to fill in the chroma plane motion vectors for a macro block when 4 different motion vectors are specified in the luma plane. This version is for use with chroma decimated in the X and Y directions. _cbmvs: The chroma block-level motion vectors to fill in. _lbmvs: The luma block-level motion vectors.*/ static void oc_set_chroma_mvs00(oc_mv _cbmvs[4],const oc_mv _lbmvs[4]){ int dx; int dy; dx=_lbmvs[0][0]+_lbmvs[1][0]+_lbmvs[2][0]+_lbmvs[3][0]; dy=_lbmvs[0][1]+_lbmvs[1][1]+_lbmvs[2][1]+_lbmvs[3][1]; _cbmvs[0][0]=(signed char)OC_DIV_ROUND_POW2(dx,2,2); _cbmvs[0][1]=(signed char)OC_DIV_ROUND_POW2(dy,2,2); }
/*The function used to fill in the chroma plane motion vectors for a macro block when 4 different motion vectors are specified in the luma plane. This version is for use with chroma decimated in the X and Y directions (4:2:0). _cbmvs: The chroma block-level motion vectors to fill in. _lbmvs: The luma block-level motion vectors.*/ static void oc_set_chroma_mvs00(oc_mv _cbmvs[4],const oc_mv _lbmvs[4]){ int dx; int dy; dx=OC_MV_X(_lbmvs[0])+OC_MV_X(_lbmvs[1]) +OC_MV_X(_lbmvs[2])+OC_MV_X(_lbmvs[3]); dy=OC_MV_Y(_lbmvs[0])+OC_MV_Y(_lbmvs[1]) +OC_MV_Y(_lbmvs[2])+OC_MV_Y(_lbmvs[3]); _cbmvs[0]=OC_MV(OC_DIV_ROUND_POW2(dx,2,2),OC_DIV_ROUND_POW2(dy,2,2)); }
/*Pads a single row of a partial block and then performs a forward Type-II DCT on the result. The output is scaled by a factor of 2 from the orthonormal version of the transform. _y: The buffer to store the result in. Data will be placed in every 8th entry (e.g., in a column of an 8x8 block). _x: The input coefficients. The first 8 entries are used (e.g., from a row of an 8x8 block). _e: The extension information for the shape.*/ static void fdct8_ext(ogg_int16_t *_y,ogg_int16_t _x[8], const oc_extension_info *_e){ if(_e->na==1){ int ci; /*While the branch below is still correct for shapes with na==1, we can perform the entire transform with just 1 multiply in this case instead of 23.*/ _y[0]=(ogg_int16_t)(OC_DIV2_16(OC_C4S4*(_x[_e->pi[0]]<<3))); for(ci=8;ci<64;ci+=8)_y[ci]=0; } else{ int zpi; int api; int nz; /*First multiply by the extension matrix to compute the padding values.*/ nz=8-_e->na; for(zpi=0;zpi<nz;zpi++){ ogg_int32_t v; v=0; for(api=0;api<_e->na;api++)v+=_e->ext[zpi][api]*_x[_e->pi[api]]; _x[_e->pi[zpi+_e->na]]= (ogg_int16_t)OC_DIV_ROUND_POW2(v,OC_EXT_SHIFT,1<<OC_EXT_SHIFT-1); } fdct8(_y,_x); } }