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
28typedef struct struct_approxDCT  approxDCT;
29struct 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
42struct QPstruct
43{
44    Int QPx2 ;
45    Int QP;
46    Int QPdiv2;
47    Int QPx2plus;
48    Int Addition;
49};
50
51/*---- FastCodeMB.c -----*/
52void initCodeMB(approxDCT *function, Int QP);
53PV_STATUS CodeMB_H263(VideoEncData *video, approxDCT *function, Int QP, Int ncoefblck[], Int offset);
54PV_STATUS CodeMB_MPEG(VideoEncData *video, approxDCT *function, Int QP, Int ncoefblck[], Int offset);
55Int getBlockSAV(Int block[]);
56Int Sad8x8(UChar *rec, UChar *prev, Int lx);
57Int getBlockSum(UChar *rec, Int lx);
58
59/*---- AppVCA_dct.c -----*/
60Int     AppVCA1_dct(Int block[], Int out[ ], approxDCT *function);
61Int     AppVCA2_dct(Int block[], Int out[ ], approxDCT *function);
62Int     AppVCA3_dct(Int block[], Int out[ ], approxDCT *function);
63Int     AppVCA4_dct(Int block[], Int out[ ], approxDCT *function);
64Int     AppVCA5_dct(Int block[], Int out[ ], approxDCT *function);
65
66/*---- FastQuant.c -----*/
67Int cal_dc_scalerENC(Int QP, Int type) ;
68Int BlockQuantDequantH263Inter(Int *rcoeff, Int *qcoeff, struct QPstruct *QuantParam,
69                               UChar bitmapcol[ ], UChar *bitmaprow, UInt *bitmapzz,
70                               Int dctMode, Int comp, Int dummy);
71
72Int BlockQuantDequantH263Intra(Int *rcoeff, Int *qcoeff, struct QPstruct *QuantParam,
73                               UChar bitmapcol[ ], UChar *bitmaprow, UInt *bitmapzz,
74                               Int dctMode, Int comp, Int dc_scaler);
75
76Int BlockQuantDequantH263DCInter(Int *rcoeff, Int *qcoeff, struct QPstruct *QuantParam,
77                                 UChar *bitmaprow, UInt *bitmapzz, Int dummy);
78
79Int BlockQuantDequantH263DCIntra(Int *rcoeff, Int *qcoeff, struct QPstruct *QuantParam,
80                                 UChar *bitmaprow, UInt *bitmapzz, Int dc_scaler);
81
82Int 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
86Int 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
90Int BlockQuantDequantMPEGDCInter(Int *rcoeff, Int *qcoeff, Int QP, Int *qmat,
91                                 UChar bitmapcol[ ], UChar *bitmaprow, UInt *bitmapzz, Int dummy);
92
93Int BlockQuantDequantMPEGDCIntra(Int *rcoeff, Int *qcoeff, Int QP, Int *qmat,
94                                 UChar bitmapcol[ ], UChar *bitmaprow, UInt *bitmapzz, Int dc_scaler);
95
96/*---- FastIDCT.c -----*/
97void BlockIDCTMotionComp(Int *block, UChar *bitmapcol, UChar bitmaprow,
98                         Int dctMode, UChar *rec, Int lx, Int intra);
99
100/*---- motion_comp.c -----*/
101void PutSkippedBlock(UChar *rec, UChar *prev, Int lx);
102
103
104