00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "libavcodec/avcodec.h"
00023 #include "libavcodec/dsputil.h"
00024 #include "libavcodec/mpegvideo.h"
00025 #include "mpegvideo_arm.h"
00026
00027 void ff_dct_unquantize_h263_armv5te(DCTELEM *block, int qmul, int qadd, int count);
00028
00029 #ifdef ENABLE_ARM_TESTS
00030
00035 static inline void dct_unquantize_h263_helper_c(DCTELEM *block, int qmul, int qadd, int count)
00036 {
00037 int i, level;
00038 for (i = 0; i < count; i++) {
00039 level = block[i];
00040 if (level) {
00041 if (level < 0) {
00042 level = level * qmul - qadd;
00043 } else {
00044 level = level * qmul + qadd;
00045 }
00046 block[i] = level;
00047 }
00048 }
00049 }
00050 #endif
00051
00052 static void dct_unquantize_h263_intra_armv5te(MpegEncContext *s,
00053 DCTELEM *block, int n, int qscale)
00054 {
00055 int level, qmul, qadd;
00056 int nCoeffs;
00057
00058 assert(s->block_last_index[n]>=0);
00059
00060 qmul = qscale << 1;
00061
00062 if (!s->h263_aic) {
00063 if (n < 4)
00064 level = block[0] * s->y_dc_scale;
00065 else
00066 level = block[0] * s->c_dc_scale;
00067 qadd = (qscale - 1) | 1;
00068 }else{
00069 qadd = 0;
00070 level = block[0];
00071 }
00072 if(s->ac_pred)
00073 nCoeffs=63;
00074 else
00075 nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
00076
00077 ff_dct_unquantize_h263_armv5te(block, qmul, qadd, nCoeffs + 1);
00078 block[0] = level;
00079 }
00080
00081 static void dct_unquantize_h263_inter_armv5te(MpegEncContext *s,
00082 DCTELEM *block, int n, int qscale)
00083 {
00084 int qmul, qadd;
00085 int nCoeffs;
00086
00087 assert(s->block_last_index[n]>=0);
00088
00089 qadd = (qscale - 1) | 1;
00090 qmul = qscale << 1;
00091
00092 nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
00093
00094 ff_dct_unquantize_h263_armv5te(block, qmul, qadd, nCoeffs + 1);
00095 }
00096
00097 void MPV_common_init_armv5te(MpegEncContext *s)
00098 {
00099 s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_armv5te;
00100 s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_armv5te;
00101 }