Home | History | Annotate | Download | only in src
      1 /* ------------------------------------------------------------------
      2  * Copyright (C) 1998-2009 PacketVideo
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
     13  * express or implied.
     14  * See the License for the specific language governing permissions
     15  * and limitations under the License.
     16  * -------------------------------------------------------------------
     17  */
     18 /*  =====================================================================   */
     19 /*  File: FastCodeMB.h                                                      */
     20 /*  Description: This file contains structure and function prototypes used
     21             in FastCodeMB() function. When it is decided to use FastCodeMB
     22             instead of CodeMB, all of this prototypes should be migrated to
     23             mp4enc_lib.h.                                                   */
     24 /*  Rev:                                                                    */
     25 /*  Created: 8/14/01                                                        */
     26 /* //////////////////////////////////////////////////////////////////////// */
     27 
     28 typedef struct struct_approxDCT  approxDCT;
     29 struct struct_approxDCT
     30 {
     31     const Int *scale;
     32     Int(*DCT)(Int block[ ], Int coeff[ ], approxDCT *);
     33 
     34     // Threshold value for H.263 Quantizer
     35     Int th_app_all[8];
     36     Int th_app_odd[8];
     37     Int th_app_even[8];
     38     Int th_app_even1[8];
     39     Int th_app_even2[8];
     40 };
     41 
     42 struct QPstruct
     43 {
     44     Int QPx2 ;
     45     Int QP;
     46     Int QPdiv2;
     47     Int QPx2plus;
     48     Int Addition;
     49 };
     50 
     51 /*---- FastCodeMB.c -----*/
     52 void initCodeMB(approxDCT *function, Int QP);
     53 PV_STATUS CodeMB_H263(VideoEncData *video, approxDCT *function, Int QP, Int ncoefblck[], Int offset);
     54 PV_STATUS CodeMB_MPEG(VideoEncData *video, approxDCT *function, Int QP, Int ncoefblck[], Int offset);
     55 Int getBlockSAV(Int block[]);
     56 Int Sad8x8(UChar *rec, UChar *prev, Int lx);
     57 Int getBlockSum(UChar *rec, Int lx);
     58 
     59 /*---- AppVCA_dct.c -----*/
     60 Int     AppVCA1_dct(Int block[], Int out[ ], approxDCT *function);
     61 Int     AppVCA2_dct(Int block[], Int out[ ], approxDCT *function);
     62 Int     AppVCA3_dct(Int block[], Int out[ ], approxDCT *function);
     63 Int     AppVCA4_dct(Int block[], Int out[ ], approxDCT *function);
     64 Int     AppVCA5_dct(Int block[], Int out[ ], approxDCT *function);
     65 
     66 /*---- FastQuant.c -----*/
     67 Int cal_dc_scalerENC(Int QP, Int type) ;
     68 Int BlockQuantDequantH263Inter(Int *rcoeff, Int *qcoeff, struct QPstruct *QuantParam,
     69                                UChar bitmapcol[ ], UChar *bitmaprow, UInt *bitmapzz,
     70                                Int dctMode, Int comp, Int dummy);
     71 
     72 Int BlockQuantDequantH263Intra(Int *rcoeff, Int *qcoeff, struct QPstruct *QuantParam,
     73                                UChar bitmapcol[ ], UChar *bitmaprow, UInt *bitmapzz,
     74                                Int dctMode, Int comp, Int dc_scaler);
     75 
     76 Int BlockQuantDequantH263DCInter(Int *rcoeff, Int *qcoeff, struct QPstruct *QuantParam,
     77                                  UChar *bitmaprow, UInt *bitmapzz, Int dummy);
     78 
     79 Int BlockQuantDequantH263DCIntra(Int *rcoeff, Int *qcoeff, struct QPstruct *QuantParam,
     80                                  UChar *bitmaprow, UInt *bitmapzz, Int dc_scaler);
     81 
     82 Int BlockQuantDequantMPEGInter(Int *rcoeff, Int *qcoeff, Int QP, Int *qmat,
     83                                UChar bitmapcol[ ], UChar *bitmaprow, UInt *bitmapzz,
     84                                Int DctMode, Int comp, Int dc_scaler);
     85 
     86 Int BlockQuantDequantMPEGIntra(Int *rcoeff, Int *qcoeff, Int QP, Int *qmat,
     87                                UChar bitmapcol[ ], UChar *bitmaprow, UInt *bitmapzz,
     88                                Int DctMode, Int comp, Int dc_scaler);
     89 
     90 Int BlockQuantDequantMPEGDCInter(Int *rcoeff, Int *qcoeff, Int QP, Int *qmat,
     91                                  UChar bitmapcol[ ], UChar *bitmaprow, UInt *bitmapzz, Int dummy);
     92 
     93 Int BlockQuantDequantMPEGDCIntra(Int *rcoeff, Int *qcoeff, Int QP, Int *qmat,
     94                                  UChar bitmapcol[ ], UChar *bitmaprow, UInt *bitmapzz, Int dc_scaler);
     95 
     96 /*---- FastIDCT.c -----*/
     97 void BlockIDCTMotionComp(Int *block, UChar *bitmapcol, UChar bitmaprow,
     98                          Int dctMode, UChar *rec, Int lx, Int intra);
     99 
    100 /*---- motion_comp.c -----*/
    101 void PutSkippedBlock(UChar *rec, UChar *prev, Int lx);
    102 
    103 
    104