• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavcodec/arm/mpegvideo_armv5te.c

Go to the documentation of this file.
00001 /*
00002  * Optimization of some functions from mpegvideo.c for armv5te
00003  * Copyright (c) 2007 Siarhei Siamashka <ssvb@users.sourceforge.net>
00004  *
00005  * This file is part of FFmpeg.
00006  *
00007  * FFmpeg is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * FFmpeg is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with FFmpeg; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00020  */
00021 
00022 #include "libavcodec/avcodec.h"
00023 #include "libavcodec/dsputil.h"
00024 #include "libavcodec/mpegvideo.h"
00025 
00026 void ff_dct_unquantize_h263_armv5te(DCTELEM *block, int qmul, int qadd, int count);
00027 
00028 #ifdef ENABLE_ARM_TESTS
00029 
00034 static inline void dct_unquantize_h263_helper_c(DCTELEM *block, int qmul, int qadd, int count)
00035 {
00036     int i, level;
00037     for (i = 0; i < count; i++) {
00038         level = block[i];
00039         if (level) {
00040             if (level < 0) {
00041                 level = level * qmul - qadd;
00042             } else {
00043                 level = level * qmul + qadd;
00044             }
00045             block[i] = level;
00046         }
00047     }
00048 }
00049 #endif
00050 
00051 static void dct_unquantize_h263_intra_armv5te(MpegEncContext *s,
00052                                   DCTELEM *block, int n, int qscale)
00053 {
00054     int level, qmul, qadd;
00055     int nCoeffs;
00056 
00057     assert(s->block_last_index[n]>=0);
00058 
00059     qmul = qscale << 1;
00060 
00061     if (!s->h263_aic) {
00062         if (n < 4)
00063             level = block[0] * s->y_dc_scale;
00064         else
00065             level = block[0] * s->c_dc_scale;
00066         qadd = (qscale - 1) | 1;
00067     }else{
00068         qadd = 0;
00069         level = block[0];
00070     }
00071     if(s->ac_pred)
00072         nCoeffs=63;
00073     else
00074         nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
00075 
00076     ff_dct_unquantize_h263_armv5te(block, qmul, qadd, nCoeffs + 1);
00077     block[0] = level;
00078 }
00079 
00080 static void dct_unquantize_h263_inter_armv5te(MpegEncContext *s,
00081                                   DCTELEM *block, int n, int qscale)
00082 {
00083     int qmul, qadd;
00084     int nCoeffs;
00085 
00086     assert(s->block_last_index[n]>=0);
00087 
00088     qadd = (qscale - 1) | 1;
00089     qmul = qscale << 1;
00090 
00091     nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
00092 
00093     ff_dct_unquantize_h263_armv5te(block, qmul, qadd, nCoeffs + 1);
00094 }
00095 
00096 void MPV_common_init_armv5te(MpegEncContext *s)
00097 {
00098     s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_armv5te;
00099     s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_armv5te;
00100 }

Generated on Tue Nov 4 2014 12:59:21 for ffmpeg by  doxygen 1.7.1