1 |
/************************************************************************** |
/***************************************************************************** |
2 |
* |
* |
3 |
* Modifications: |
* XVID MPEG-4 VIDEO CODEC |
4 |
|
* - Motion estimation fuctions header file - |
5 |
* |
* |
6 |
* 29.03.2002 removed MBFieldToFrame - no longer used (transfers instead) |
* Copyright(C) 2002 Michael Militzer |
|
* 26.03.2002 interlacing support |
|
|
* 02.12.2001 motion estimation/compensation split |
|
|
* 16.11.2001 const/uint32_t changes to MBMotionEstComp() |
|
|
* 26.08.2001 added inter4v_mode parameter to MBMotionEstComp() |
|
7 |
* |
* |
8 |
* Michael Militzer <isibaar@videocoding.de> |
* This program is an implementation of a part of one or more MPEG-4 |
9 |
|
* Video tools as specified in ISO/IEC 14496-2 standard. Those intending |
10 |
|
* to use this software module in hardware or software products are |
11 |
|
* advised that its use may infringe existing patents or copyrights, and |
12 |
|
* any such use would be at such party's own risk. The original |
13 |
|
* developer of this software module and his/her company, and subsequent |
14 |
|
* editors and their companies, will have no liability for use of this |
15 |
|
* software or modifications or derivatives thereof. |
16 |
* |
* |
17 |
**************************************************************************/ |
* This program is free software; you can redistribute it and/or modify |
18 |
|
* it under the terms of the GNU General Public License as published by |
19 |
|
* the Free Software Foundation; either version 2 of the License, or |
20 |
|
* (at your option) any later version. |
21 |
|
* |
22 |
|
* This program is distributed in the hope that it will be useful, |
23 |
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
24 |
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
25 |
|
* GNU General Public License for more details. |
26 |
|
* |
27 |
|
* You should have received a copy of the GNU General Public License |
28 |
|
* along with this program; if not, write to the Free Software |
29 |
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
30 |
|
* |
31 |
|
* $Id: mbfunctions.h,v 1.11 2002-09-05 21:13:22 edgomez Exp $ |
32 |
|
* |
33 |
|
****************************************************************************/ |
34 |
|
|
35 |
#ifndef _ENCORE_BLOCK_H |
#ifndef _MBFUNCTIONS_H |
36 |
#define _ENCORE_BLOCK_H |
#define _MBFUNCTIONS_H |
37 |
|
|
38 |
#include "../encoder.h" |
#include "../encoder.h" |
39 |
#include "../bitstream/bitstream.h" |
#include "../bitstream/bitstream.h" |
40 |
|
|
41 |
|
/***************************************************************************** |
42 |
|
* Prototypes |
43 |
|
****************************************************************************/ |
44 |
|
|
45 |
|
|
46 |
/** MotionEstimation **/ |
/* MotionEstimation */ |
47 |
|
|
48 |
bool MotionEstimation(MBParam * const pParam, |
bool MotionEstimation(MBParam * const pParam, |
49 |
FRAMEINFO * const current, |
FRAMEINFO * const current, |
64 |
|
|
65 |
|
|
66 |
|
|
67 |
/** MBMotionCompensation **/ |
/* MBMotionCompensation */ |
68 |
|
|
69 |
void MBMotionCompensation(MACROBLOCK * const pMB, |
void MBMotionCompensation(MACROBLOCK * const pMB, |
70 |
const uint32_t j, |
const uint32_t j, |
71 |
const uint32_t i, |
const uint32_t i, |
81 |
const uint32_t rounding); |
const uint32_t rounding); |
82 |
|
|
83 |
|
|
84 |
/** MBTransQuant.c **/ |
/* MBTransQuant.c */ |
|
|
|
85 |
|
|
86 |
void MBTransQuantIntra(const MBParam * pParam, |
void MBTransQuantIntra(const MBParam * pParam, |
87 |
FRAMEINFO * frame, |
FRAMEINFO * frame, |
88 |
MACROBLOCK * pMB, |
MACROBLOCK * pMB, |
89 |
const uint32_t x_pos, /* <-- The x position of the MB to be searched */ |
const uint32_t x_pos, /* <-- The x position of the MB to be searched */ |
|
|
|
90 |
const uint32_t y_pos, /* <-- The y position of the MB to be searched */ |
const uint32_t y_pos, /* <-- The y position of the MB to be searched */ |
|
|
|
91 |
int16_t data[6 * 64], /* <-> the data of the MB to be coded */ |
int16_t data[6 * 64], /* <-> the data of the MB to be coded */ |
92 |
|
int16_t qcoeff[6 * 64]); /* <-> the quantized DCT coefficients */ |
93 |
|
|
|
int16_t qcoeff[6 * 64] /* <-> the quantized DCT coefficients */ |
|
|
); |
|
94 |
|
|
95 |
|
|
96 |
void MBTransQuantIntra2(const MBParam * pParam, |
void MBTransQuantIntra2(const MBParam * pParam, |
97 |
FRAMEINFO * frame, |
FRAMEINFO * frame, |
98 |
MACROBLOCK * pMB, |
MACROBLOCK * pMB, |
99 |
const uint32_t x_pos, /* <-- The x position of the MB to be searched */ |
const uint32_t x_pos, /* <-- The x position of the MB to be searched */ |
|
|
|
100 |
const uint32_t y_pos, /* <-- The y position of the MB to be searched */ |
const uint32_t y_pos, /* <-- The y position of the MB to be searched */ |
|
|
|
101 |
int16_t data[6 * 64], /* <-> the data of the MB to be coded */ |
int16_t data[6 * 64], /* <-> the data of the MB to be coded */ |
102 |
|
int16_t qcoeff[6 * 64]); /* <-> the quantized DCT coefficients */ |
103 |
|
|
|
int16_t qcoeff[6 * 64] /* <-> the quantized DCT coefficients */ |
|
|
); |
|
104 |
|
|
105 |
|
|
106 |
uint8_t MBTransQuantInter(const MBParam * pParam, |
uint8_t MBTransQuantInter(const MBParam * pParam, |
167 |
const uint8_t cbp); |
const uint8_t cbp); |
168 |
|
|
169 |
|
|
170 |
void MBiDCT( int16_t data[6 * 64], |
void MBiDCT(nt16_t data[6 * 64], |
171 |
const uint8_t cbp); |
const uint8_t cbp); |
172 |
|
|
173 |
|
|
181 |
|
|
182 |
|
|
183 |
|
|
184 |
/** interlacing **/ |
/* interlacing */ |
185 |
|
|
186 |
uint32_t MBDecideFieldDCT(int16_t data[6 * 64]); /* <- decide whether to use field-based DCT |
uint32_t MBDecideFieldDCT(int16_t data[6 * 64]); /* <- decide whether to use field-based DCT for interlacing */ |
|
for interlacing */ |
|
187 |
|
|
188 |
void MBFrameToField(int16_t data[6 * 64]); /* de-interlace vertical Y blocks */ |
void MBFrameToField(int16_t data[6 * 64]); /* de-interlace vertical Y blocks */ |
189 |
|
|
190 |
|
|
191 |
/** MBCoding.c **/ |
/* MBCoding.c */ |
192 |
|
|
193 |
void MBSkip(Bitstream * bs); /* just the bitstream. Since MB is skipped, no info is needed */ |
void MBSkip(Bitstream * bs); /* just the bitstream. Since MB is skipped, no info is needed */ |
194 |
|
|
195 |
|
|
196 |
void MBCoding(const FRAMEINFO * frame, /* <-- the parameter for coding of the bitstream */ |
void MBCoding(const FRAMEINFO * frame, /* <-- the parameter for coding of the bitstream */ |
|
|
|
197 |
MACROBLOCK * pMB, /* <-- Info of the MB to be coded */ |
MACROBLOCK * pMB, /* <-- Info of the MB to be coded */ |
|
|
|
198 |
int16_t qcoeff[6 * 64], /* <-- the quantized DCT coefficients */ |
int16_t qcoeff[6 * 64], /* <-- the quantized DCT coefficients */ |
|
|
|
199 |
Bitstream * bs, /* <-> the bitstream */ |
Bitstream * bs, /* <-> the bitstream */ |
200 |
|
Statistics * pStat); /* <-> statistical data collected for current frame */ |
|
Statistics * pStat /* <-> statistical data collected for current frame */ |
|
|
); |
|
201 |
|
|
202 |
#endif |
#endif |