#include "prj.h" #include "stdlib.h" /* make a dct to a block */ int cod_intra(short qn,short f,short q,short p,short table[N][N]) { unsigned short i,j; unsigned short dc; for(j=0;j255)? 255:table[j][i]; } int cod_inter(short qn,short f,short q,short p,short table[N][N]) { unsigned short i,j; residue(f,q*N,p*N,mv_y[f][q/2][p/2],mv_x[f][q/2][p/2],table); dct(table,dct_value[f][q*LY+p]); quant(qn,dct_value[f][q*LY+p]); return bitlen[f][q*LY+p]=tcoeff(dct_value[f][q*LY+p],N*N); } int fake_cod_inter(short qn,short f,short q,short p,short fake_x,short fake_y,short table[N][N]) { unsigned short i,j; residue(f,q*N,p*N,fake_y,fake_x,table); dct(table,dct_value[f][q*LY+p]); quant(qn,dct_value[f][q*LY+p]); return bitlen[f][q*LY+p]=tcoeff(dct_value[f][q*LY+p],N*N); } int fake_decod_inter(short qn,short f,short q,short p,short fake_x,short fake_y,short table[N][N]) { unsigned short i,j; iquant(qn,dct_value[f][q*LY+p]); idct(table,dct_value[f][q*LY+p]); iresidue(f,q*N,p*N,fake_y,fake_x,table); } decod_inter(short qn,short f, short q,short p,short table[N][N]) { unsigned short i,j; iquant(qn,dct_value[f][q*LY+p]); idct(table,dct_value[f][q*LY+p]); iresidue(f,q*N,p*N,mv_y[f][q/2][p/2],mv_x[f][q/2][p/2],table); } /* main() { unsigned short i,j; short table[N][N]; short mx,my,p,q; short stat[N][N]; p=2; q=3; mx=-3; my=-4; mv_y[1][q/2][p/2]=my; mv_x[1][q/2][p/2]=mx; set_eigen(); set_zigzag(); for(i=0;i