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

libavcodec/arm/dsputil_init_arm.c

Go to the documentation of this file.
00001 /*
00002  * ARM optimized DSP utils
00003  * Copyright (c) 2001 Lionel Ulmer
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/dsputil.h"
00023 #include "dsputil_arm.h"
00024 
00025 void ff_j_rev_dct_arm(DCTELEM *data);
00026 void ff_simple_idct_arm(DCTELEM *data);
00027 
00028 /* XXX: local hack */
00029 static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
00030 static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
00031 
00032 void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
00033 void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
00034 void ff_put_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
00035 void ff_put_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
00036 
00037 void ff_put_no_rnd_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
00038 void ff_put_no_rnd_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
00039 void ff_put_no_rnd_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
00040 
00041 void ff_put_pixels16_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
00042 
00043 CALL_2X_PIXELS(ff_put_pixels16_x2_arm,         ff_put_pixels8_x2_arm,        8)
00044 CALL_2X_PIXELS(ff_put_pixels16_y2_arm,         ff_put_pixels8_y2_arm,        8)
00045 CALL_2X_PIXELS(ff_put_pixels16_xy2_arm,        ff_put_pixels8_xy2_arm,       8)
00046 CALL_2X_PIXELS(ff_put_no_rnd_pixels16_x2_arm,  ff_put_no_rnd_pixels8_x2_arm, 8)
00047 CALL_2X_PIXELS(ff_put_no_rnd_pixels16_y2_arm,  ff_put_no_rnd_pixels8_y2_arm, 8)
00048 CALL_2X_PIXELS(ff_put_no_rnd_pixels16_xy2_arm, ff_put_no_rnd_pixels8_xy2_arm,8)
00049 
00050 void ff_add_pixels_clamped_arm(const DCTELEM *block, uint8_t *dest,
00051                                int line_size);
00052 
00053 /* XXX: those functions should be suppressed ASAP when all IDCTs are
00054    converted */
00055 static void j_rev_dct_arm_put(uint8_t *dest, int line_size, DCTELEM *block)
00056 {
00057     ff_j_rev_dct_arm (block);
00058     ff_put_pixels_clamped(block, dest, line_size);
00059 }
00060 static void j_rev_dct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)
00061 {
00062     ff_j_rev_dct_arm (block);
00063     ff_add_pixels_clamped(block, dest, line_size);
00064 }
00065 static void simple_idct_arm_put(uint8_t *dest, int line_size, DCTELEM *block)
00066 {
00067     ff_simple_idct_arm (block);
00068     ff_put_pixels_clamped(block, dest, line_size);
00069 }
00070 static void simple_idct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)
00071 {
00072     ff_simple_idct_arm (block);
00073     ff_add_pixels_clamped(block, dest, line_size);
00074 }
00075 
00076 int mm_support(void)
00077 {
00078     return HAVE_IWMMXT * FF_MM_IWMMXT;
00079 }
00080 
00081 void dsputil_init_arm(DSPContext* c, AVCodecContext *avctx)
00082 {
00083     ff_put_pixels_clamped = c->put_pixels_clamped;
00084     ff_add_pixels_clamped = c->add_pixels_clamped;
00085 
00086     if (!avctx->lowres) {
00087         if(avctx->idct_algo == FF_IDCT_AUTO ||
00088            avctx->idct_algo == FF_IDCT_ARM){
00089             c->idct_put              = j_rev_dct_arm_put;
00090             c->idct_add              = j_rev_dct_arm_add;
00091             c->idct                  = ff_j_rev_dct_arm;
00092             c->idct_permutation_type = FF_LIBMPEG2_IDCT_PERM;
00093         } else if (avctx->idct_algo == FF_IDCT_SIMPLEARM){
00094             c->idct_put              = simple_idct_arm_put;
00095             c->idct_add              = simple_idct_arm_add;
00096             c->idct                  = ff_simple_idct_arm;
00097             c->idct_permutation_type = FF_NO_IDCT_PERM;
00098         }
00099     }
00100 
00101     c->add_pixels_clamped = ff_add_pixels_clamped_arm;
00102 
00103     c->put_pixels_tab[0][0] = ff_put_pixels16_arm;
00104     c->put_pixels_tab[0][1] = ff_put_pixels16_x2_arm;
00105     c->put_pixels_tab[0][2] = ff_put_pixels16_y2_arm;
00106     c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_arm;
00107     c->put_pixels_tab[1][0] = ff_put_pixels8_arm;
00108     c->put_pixels_tab[1][1] = ff_put_pixels8_x2_arm;
00109     c->put_pixels_tab[1][2] = ff_put_pixels8_y2_arm;
00110     c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_arm;
00111 
00112     c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_arm;
00113     c->put_no_rnd_pixels_tab[0][1] = ff_put_no_rnd_pixels16_x2_arm;
00114     c->put_no_rnd_pixels_tab[0][2] = ff_put_no_rnd_pixels16_y2_arm;
00115     c->put_no_rnd_pixels_tab[0][3] = ff_put_no_rnd_pixels16_xy2_arm;
00116     c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_arm;
00117     c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_arm;
00118     c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_arm;
00119     c->put_no_rnd_pixels_tab[1][3] = ff_put_no_rnd_pixels8_xy2_arm;
00120 
00121     if (HAVE_ARMV5TE) ff_dsputil_init_armv5te(c, avctx);
00122     if (HAVE_ARMV6)   ff_dsputil_init_armv6(c, avctx);
00123     if (HAVE_IWMMXT)  ff_dsputil_init_iwmmxt(c, avctx);
00124     if (HAVE_ARMVFP)  ff_dsputil_init_vfp(c, avctx);
00125     if (HAVE_NEON)    ff_dsputil_init_neon(c, avctx);
00126 }

Generated on Fri Sep 16 2011 17:17:33 for FFmpeg by  doxygen 1.7.1