[svn] / trunk / xvidcore / src / image / qpel.c Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/image/qpel.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1557, Sun Oct 17 10:20:15 2004 UTC revision 1653, Tue Nov 22 10:23:01 2005 UTC
# Line 19  Line 19 
19   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
20   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21   *   *
22   * $Id: qpel.c,v 1.4 2004-10-17 10:20:15 edgomez Exp $   * $Id: qpel.c,v 1.8 2005-11-22 10:23:01 suxen_drol Exp $
23   *   *
24   ****************************************************************************/   ****************************************************************************/
25    
26  #ifndef XVID_AUTO_INCLUDE  #ifndef XVID_AUTO_INCLUDE
27    
28    #include <stdio.h>
29    
30  #include "../portab.h"  #include "../portab.h"
31  #include "qpel.h"  #include "qpel.h"
32    
# Line 197  Line 199 
199  /* Global scope hooks  /* Global scope hooks
200   ****************************************************************************/   ****************************************************************************/
201    
202  XVID_QP_FUNCS *xvid_QP_Funcs = 0;  XVID_QP_FUNCS *xvid_QP_Funcs = NULL;
203  XVID_QP_FUNCS *xvid_QP_Add_Funcs = 0;  XVID_QP_FUNCS *xvid_QP_Add_Funcs = NULL;
204    
205  /* Reference plain C impl. declaration  /* Reference plain C impl. declaration
206   ****************************************************************************/   ****************************************************************************/
# Line 340  Line 342 
342    
343  #endif /* ARCH_IS_PPC */  #endif /* ARCH_IS_PPC */
344    
345    /* mmx impl. (for 64bit bus) declaration (see. qpel_mmx.asm
346     ****************************************************************************/
347    
348    #ifdef ARCH_IS_X86_64
349    extern XVID_QP_PASS_SIGNATURE(xvid_H_Pass_16_x86_64);
350    extern XVID_QP_PASS_SIGNATURE(xvid_H_Pass_Avrg_16_x86_64);
351    extern XVID_QP_PASS_SIGNATURE(xvid_H_Pass_Avrg_Up_16_x86_64);
352    extern XVID_QP_PASS_SIGNATURE(xvid_V_Pass_16_x86_64);
353    extern XVID_QP_PASS_SIGNATURE(xvid_V_Pass_Avrg_16_x86_64);
354    extern XVID_QP_PASS_SIGNATURE(xvid_V_Pass_Avrg_Up_16_x86_64);
355    
356    extern XVID_QP_PASS_SIGNATURE(xvid_H_Pass_8_x86_64);
357    extern XVID_QP_PASS_SIGNATURE(xvid_H_Pass_Avrg_8_x86_64);
358    extern XVID_QP_PASS_SIGNATURE(xvid_H_Pass_Avrg_Up_8_x86_64);
359    extern XVID_QP_PASS_SIGNATURE(xvid_V_Pass_8_x86_64);
360    extern XVID_QP_PASS_SIGNATURE(xvid_V_Pass_Avrg_8_x86_64);
361    extern XVID_QP_PASS_SIGNATURE(xvid_V_Pass_Avrg_Up_8_x86_64);
362    
363    extern XVID_QP_PASS_SIGNATURE(xvid_H_Pass_Add_16_x86_64);
364    extern XVID_QP_PASS_SIGNATURE(xvid_H_Pass_Avrg_Add_16_x86_64);
365    extern XVID_QP_PASS_SIGNATURE(xvid_H_Pass_Avrg_Up_Add_16_x86_64);
366    extern XVID_QP_PASS_SIGNATURE(xvid_V_Pass_Add_16_x86_64);
367    extern XVID_QP_PASS_SIGNATURE(xvid_V_Pass_Avrg_Add_16_x86_64);
368    extern XVID_QP_PASS_SIGNATURE(xvid_V_Pass_Avrg_Up_Add_16_x86_64);
369    
370    extern XVID_QP_PASS_SIGNATURE(xvid_H_Pass_8_Add_x86_64);
371    extern XVID_QP_PASS_SIGNATURE(xvid_H_Pass_Avrg_8_Add_x86_64);
372    extern XVID_QP_PASS_SIGNATURE(xvid_H_Pass_Avrg_Up_8_Add_x86_64);
373    extern XVID_QP_PASS_SIGNATURE(xvid_V_Pass_8_Add_x86_64);
374    extern XVID_QP_PASS_SIGNATURE(xvid_V_Pass_Avrg_8_Add_x86_64);
375    extern XVID_QP_PASS_SIGNATURE(xvid_V_Pass_Avrg_Up_8_Add_x86_64);
376    
377    XVID_QP_FUNCS xvid_QP_Funcs_x86_64 = {
378            xvid_H_Pass_16_x86_64, xvid_H_Pass_Avrg_16_x86_64, xvid_H_Pass_Avrg_Up_16_x86_64,
379            xvid_V_Pass_16_x86_64, xvid_V_Pass_Avrg_16_x86_64, xvid_V_Pass_Avrg_Up_16_x86_64,
380    
381            xvid_H_Pass_8_x86_64, xvid_H_Pass_Avrg_8_x86_64, xvid_H_Pass_Avrg_Up_8_x86_64,
382            xvid_V_Pass_8_x86_64, xvid_V_Pass_Avrg_8_x86_64, xvid_V_Pass_Avrg_Up_8_x86_64
383    };
384    
385    XVID_QP_FUNCS xvid_QP_Add_Funcs_x86_64 = {
386            xvid_H_Pass_Add_16_x86_64, xvid_H_Pass_Avrg_Add_16_x86_64, xvid_H_Pass_Avrg_Up_Add_16_x86_64,
387            xvid_V_Pass_Add_16_x86_64, xvid_V_Pass_Avrg_Add_16_x86_64, xvid_V_Pass_Avrg_Up_Add_16_x86_64,
388    
389            xvid_H_Pass_8_Add_x86_64, xvid_H_Pass_Avrg_8_Add_x86_64, xvid_H_Pass_Avrg_Up_8_Add_x86_64,
390            xvid_V_Pass_8_Add_x86_64, xvid_V_Pass_Avrg_8_Add_x86_64, xvid_V_Pass_Avrg_Up_8_Add_x86_64,
391    };
392    #endif /* ARCH_IS_X86_64 */
393    
394  /* tables for ASM  /* tables for ASM
395   ****************************************************************************/   ****************************************************************************/
396    
397    
398    #if defined(ARCH_IS_IA32) || defined(ARCH_IS_X86_64)
399    /* These symbols will be used outsie this file, so tell the compiler
400     * they're global. Only ia32 will define them in this file, x86_64
401     * will do in the assembly files */
402    extern uint16_t xvid_Expand_mmx[256][4]; /* 8b -> 64b expansion table */
403    
404    extern int16_t xvid_FIR_1_0_0_0[256][4];
405    extern int16_t xvid_FIR_3_1_0_0[256][4];
406    extern int16_t xvid_FIR_6_3_1_0[256][4];
407    extern int16_t xvid_FIR_14_3_2_1[256][4];
408    extern int16_t xvid_FIR_20_6_3_1[256][4];
409    extern int16_t xvid_FIR_20_20_6_3[256][4];
410    extern int16_t xvid_FIR_23_19_6_3[256][4];
411    extern int16_t xvid_FIR_7_20_20_6[256][4];
412    extern int16_t xvid_FIR_6_20_20_6[256][4];
413    extern int16_t xvid_FIR_6_20_20_7[256][4];
414    extern int16_t xvid_FIR_3_6_20_20[256][4];
415    extern int16_t xvid_FIR_3_6_19_23[256][4];
416    extern int16_t xvid_FIR_1_3_6_20[256][4];
417    extern int16_t xvid_FIR_1_2_3_14[256][4];
418    extern int16_t xvid_FIR_0_1_3_6[256][4];
419    extern int16_t xvid_FIR_0_0_1_3[256][4];
420    extern int16_t xvid_FIR_0_0_0_1[256][4];
421    #endif
422    
423    /* Arrays definitions, according to the target platform */
424  #ifdef ARCH_IS_IA32  #ifdef ARCH_IS_IA32
425  uint16_t xvid_Expand_mmx[256][4]; /* 8b -> 64b expansion table */  uint16_t xvid_Expand_mmx[256][4]; /* 8b -> 64b expansion table */
426  #endif  #endif
427    
428  /* Alternate way of filtering (cf. USE_TABLES flag in qpel_mmx.asm)  #if !defined(ARCH_IS_X86_64)
429   *  /* Only ia32 will use these tables outside this file so mark them
430   * 17 tables, 2K each => 34K  * static for all other archs */
431   * Mirroring can be acheived composing 11 basic tables  #if defined(ARCH_IS_IA32)
432   * (for instance: (23,19,-6,3)=(20,20,-6,3)+(3,-1,0,0)  #define __SCOPE
433   * Using Symmetries (and bswap) could reduce further  #else
434   * the memory to 7 tables (->14K). */  #define __SCOPE static
435    #endif
436  int16_t xvid_FIR_1_0_0_0[256][4];  __SCOPE int16_t xvid_FIR_1_0_0_0[256][4];
437  int16_t xvid_FIR_3_1_0_0[256][4];  __SCOPE int16_t xvid_FIR_3_1_0_0[256][4];
438  int16_t xvid_FIR_6_3_1_0[256][4];  __SCOPE int16_t xvid_FIR_6_3_1_0[256][4];
439  int16_t xvid_FIR_14_3_2_1[256][4];  __SCOPE int16_t xvid_FIR_14_3_2_1[256][4];
440  int16_t xvid_FIR_20_6_3_1[256][4];  __SCOPE int16_t xvid_FIR_20_6_3_1[256][4];
441  int16_t xvid_FIR_20_20_6_3[256][4];  __SCOPE int16_t xvid_FIR_20_20_6_3[256][4];
442  int16_t xvid_FIR_23_19_6_3[256][4];  __SCOPE int16_t xvid_FIR_23_19_6_3[256][4];
443  int16_t xvid_FIR_7_20_20_6[256][4];  __SCOPE int16_t xvid_FIR_7_20_20_6[256][4];
444  int16_t xvid_FIR_6_20_20_6[256][4];  __SCOPE int16_t xvid_FIR_6_20_20_6[256][4];
445  int16_t xvid_FIR_6_20_20_7[256][4];  __SCOPE int16_t xvid_FIR_6_20_20_7[256][4];
446  int16_t xvid_FIR_3_6_20_20[256][4];  __SCOPE int16_t xvid_FIR_3_6_20_20[256][4];
447  int16_t xvid_FIR_3_6_19_23[256][4];  __SCOPE int16_t xvid_FIR_3_6_19_23[256][4];
448  int16_t xvid_FIR_1_3_6_20[256][4];  __SCOPE int16_t xvid_FIR_1_3_6_20[256][4];
449  int16_t xvid_FIR_1_2_3_14[256][4];  __SCOPE int16_t xvid_FIR_1_2_3_14[256][4];
450  int16_t xvid_FIR_0_1_3_6[256][4];  __SCOPE int16_t xvid_FIR_0_1_3_6[256][4];
451  int16_t xvid_FIR_0_0_1_3[256][4];  __SCOPE int16_t xvid_FIR_0_0_1_3[256][4];
452  int16_t xvid_FIR_0_0_0_1[256][4];  __SCOPE int16_t xvid_FIR_0_0_0_1[256][4];
453    #endif
454    
455  static void Init_FIR_Table(int16_t Tab[][4],  static void Init_FIR_Table(int16_t Tab[][4],
456                             int A, int B, int C, int D)                             int A, int B, int C, int D)
# Line 386  Line 465 
465  }  }
466    
467    
468  void xvid_Init_QP()  void xvid_Init_QP(void)
469  {  {
470  #ifdef ARCH_IS_IA32  #ifdef ARCH_IS_IA32
471          int i;          int i;

Legend:
Removed from v.1557  
changed lines
  Added in v.1653

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4