00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "libavcodec/avcodec.h"
00024 #include "libavcodec/dsputil.h"
00025 #include "libavcodec/mpegvideo.h"
00026
00027 static void dct_unquantize_h263_mmi(MpegEncContext *s,
00028 DCTELEM *block, int n, int qscale)
00029 {
00030 int level=0, qmul, qadd;
00031 int nCoeffs;
00032
00033 assert(s->block_last_index[n]>=0);
00034
00035 qadd = (qscale - 1) | 1;
00036 qmul = qscale << 1;
00037
00038 if (s->mb_intra) {
00039 if (!s->h263_aic) {
00040 if (n < 4)
00041 level = block[0] * s->y_dc_scale;
00042 else
00043 level = block[0] * s->c_dc_scale;
00044 }else {
00045 qadd = 0;
00046 level = block[0];
00047 }
00048 nCoeffs= 63;
00049 } else {
00050 nCoeffs= s->intra_scantable.raster_end[ s->block_last_index[n] ];
00051 }
00052
00053 __asm__ volatile(
00054 "add $14, $0, %3 \n\t"
00055 "pcpyld $8, %0, %0 \n\t"
00056 "pcpyh $8, $8 \n\t"
00057 "pcpyld $9, %1, %1 \n\t"
00058 "pcpyh $9, $9 \n\t"
00059 ".p2align 2 \n\t"
00060 "1: \n\t"
00061 "lq $10, 0($14) \n\t"
00062 "addi $14, $14, 16 \n\t"
00063 "addi %2, %2, -8 \n\t"
00064 "pcgth $11, $0, $10 \n\t"
00065 "pcgth $12, $10, $0 \n\t"
00066 "por $12, $11, $12 \n\t"
00067 "pmulth $10, $10, $8 \n\t"
00068 "paddh $13, $9, $11 \n\t"
00069 "pxor $13, $13, $11 \n\t"
00070 "pmfhl.uw $11 \n\t"
00071 "pinteh $10, $11, $10 \n\t"
00072 "paddh $10, $10, $13 \n\t"
00073 "pand $10, $10, $12 \n\t"
00074 "sq $10, -16($14) \n\t"
00075 "bgez %2, 1b \n\t"
00076 :: "r"(qmul), "r" (qadd), "r" (nCoeffs), "r" (block) : "$8", "$9", "$10", "$11", "$12", "$13", "$14", "memory" );
00077
00078 if(s->mb_intra)
00079 block[0]= level;
00080 }
00081
00082
00083 void MPV_common_init_mmi(MpegEncContext *s)
00084 {
00085 s->dct_unquantize_h263_intra =
00086 s->dct_unquantize_h263_inter = dct_unquantize_h263_mmi;
00087 }
00088
00089