10c1bc742181ded4930842b46e9507372f0b1b963James Dong/*
20c1bc742181ded4930842b46e9507372f0b1b963James Dong * Copyright (C) 2009 The Android Open Source Project
30c1bc742181ded4930842b46e9507372f0b1b963James Dong *
40c1bc742181ded4930842b46e9507372f0b1b963James Dong * Licensed under the Apache License, Version 2.0 (the "License");
50c1bc742181ded4930842b46e9507372f0b1b963James Dong * you may not use this file except in compliance with the License.
60c1bc742181ded4930842b46e9507372f0b1b963James Dong * You may obtain a copy of the License at
70c1bc742181ded4930842b46e9507372f0b1b963James Dong *
80c1bc742181ded4930842b46e9507372f0b1b963James Dong *      http://www.apache.org/licenses/LICENSE-2.0
90c1bc742181ded4930842b46e9507372f0b1b963James Dong *
100c1bc742181ded4930842b46e9507372f0b1b963James Dong * Unless required by applicable law or agreed to in writing, software
110c1bc742181ded4930842b46e9507372f0b1b963James Dong * distributed under the License is distributed on an "AS IS" BASIS,
120c1bc742181ded4930842b46e9507372f0b1b963James Dong * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
130c1bc742181ded4930842b46e9507372f0b1b963James Dong * See the License for the specific language governing permissions and
140c1bc742181ded4930842b46e9507372f0b1b963James Dong * limitations under the License.
150c1bc742181ded4930842b46e9507372f0b1b963James Dong */
160c1bc742181ded4930842b46e9507372f0b1b963James Dong
170c1bc742181ded4930842b46e9507372f0b1b963James Dong/*------------------------------------------------------------------------------
180c1bc742181ded4930842b46e9507372f0b1b963James Dong
190c1bc742181ded4930842b46e9507372f0b1b963James Dong    Table of contents
200c1bc742181ded4930842b46e9507372f0b1b963James Dong
210c1bc742181ded4930842b46e9507372f0b1b963James Dong    1. Include headers
220c1bc742181ded4930842b46e9507372f0b1b963James Dong    2. Module defines
230c1bc742181ded4930842b46e9507372f0b1b963James Dong    3. Data types
240c1bc742181ded4930842b46e9507372f0b1b963James Dong    4. Function prototypes
250c1bc742181ded4930842b46e9507372f0b1b963James Dong
260c1bc742181ded4930842b46e9507372f0b1b963James Dong------------------------------------------------------------------------------*/
270c1bc742181ded4930842b46e9507372f0b1b963James Dong
280c1bc742181ded4930842b46e9507372f0b1b963James Dong#ifndef H264SWDEC_RECONSTRUCT_H
290c1bc742181ded4930842b46e9507372f0b1b963James Dong#define H264SWDEC_RECONSTRUCT_H
300c1bc742181ded4930842b46e9507372f0b1b963James Dong
310c1bc742181ded4930842b46e9507372f0b1b963James Dong/*------------------------------------------------------------------------------
320c1bc742181ded4930842b46e9507372f0b1b963James Dong    1. Include headers
330c1bc742181ded4930842b46e9507372f0b1b963James Dong------------------------------------------------------------------------------*/
340c1bc742181ded4930842b46e9507372f0b1b963James Dong
350c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "basetype.h"
360c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "h264bsd_macroblock_layer.h"
370c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "h264bsd_image.h"
380c1bc742181ded4930842b46e9507372f0b1b963James Dong
390c1bc742181ded4930842b46e9507372f0b1b963James Dong/*------------------------------------------------------------------------------
400c1bc742181ded4930842b46e9507372f0b1b963James Dong    2. Module defines
410c1bc742181ded4930842b46e9507372f0b1b963James Dong------------------------------------------------------------------------------*/
420c1bc742181ded4930842b46e9507372f0b1b963James Dong
430c1bc742181ded4930842b46e9507372f0b1b963James Dong/*------------------------------------------------------------------------------
440c1bc742181ded4930842b46e9507372f0b1b963James Dong    3. Data types
450c1bc742181ded4930842b46e9507372f0b1b963James Dong------------------------------------------------------------------------------*/
460c1bc742181ded4930842b46e9507372f0b1b963James Dong
470c1bc742181ded4930842b46e9507372f0b1b963James Dong/*------------------------------------------------------------------------------
480c1bc742181ded4930842b46e9507372f0b1b963James Dong    4. Function prototypes
490c1bc742181ded4930842b46e9507372f0b1b963James Dong------------------------------------------------------------------------------*/
500c1bc742181ded4930842b46e9507372f0b1b963James Dong#ifndef H264DEC_OMXDL
510c1bc742181ded4930842b46e9507372f0b1b963James Dongvoid h264bsdPredictSamples(
520c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *data,
530c1bc742181ded4930842b46e9507372f0b1b963James Dong  mv_t *mv,
540c1bc742181ded4930842b46e9507372f0b1b963James Dong  image_t *refPic,
550c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 xA,
560c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 yA,
570c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partX,
580c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partY,
590c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partWidth,
600c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partHeight);
610c1bc742181ded4930842b46e9507372f0b1b963James Dong#else
620c1bc742181ded4930842b46e9507372f0b1b963James Dongvoid h264bsdPredictSamples(
630c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *data,
640c1bc742181ded4930842b46e9507372f0b1b963James Dong  mv_t *mv,
650c1bc742181ded4930842b46e9507372f0b1b963James Dong  image_t *refPic,
660c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 colAndRow,/* packaged data | column    | row                |*/
670c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 part,     /* packaged data |partX|partY|partWidth|partHeight|*/
680c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *pFill);
690c1bc742181ded4930842b46e9507372f0b1b963James Dong#endif
700c1bc742181ded4930842b46e9507372f0b1b963James Dong
710c1bc742181ded4930842b46e9507372f0b1b963James Dongvoid h264bsdFillBlock(
720c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 * ref,
730c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 * fill,
740c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 x0,
750c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 y0,
760c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 width,
770c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 height,
780c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 blockWidth,
790c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 blockHeight,
800c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 fillScanLength);
810c1bc742181ded4930842b46e9507372f0b1b963James Dong
820c1bc742181ded4930842b46e9507372f0b1b963James Dongvoid h264bsdInterpolateChromaHor(
830c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *pRef,
840c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *predPartChroma,
850c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 x0,
860c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 y0,
870c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 width,
880c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 height,
890c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 xFrac,
900c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 chromaPartWidth,
910c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 chromaPartHeight);
920c1bc742181ded4930842b46e9507372f0b1b963James Dong
930c1bc742181ded4930842b46e9507372f0b1b963James Dongvoid h264bsdInterpolateChromaVer(
940c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *pRef,
950c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *predPartChroma,
960c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 x0,
970c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 y0,
980c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 width,
990c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 height,
1000c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 yFrac,
1010c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 chromaPartWidth,
1020c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 chromaPartHeight);
1030c1bc742181ded4930842b46e9507372f0b1b963James Dong
1040c1bc742181ded4930842b46e9507372f0b1b963James Dongvoid h264bsdInterpolateChromaHorVer(
1050c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *ref,
1060c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *predPartChroma,
1070c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 x0,
1080c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 y0,
1090c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 width,
1100c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 height,
1110c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 xFrac,
1120c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 yFrac,
1130c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 chromaPartWidth,
1140c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 chromaPartHeight);
1150c1bc742181ded4930842b46e9507372f0b1b963James Dong
1160c1bc742181ded4930842b46e9507372f0b1b963James Dongvoid h264bsdInterpolateVerHalf(
1170c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *ref,
1180c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *mb,
1190c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 x0,
1200c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 y0,
1210c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 width,
1220c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 height,
1230c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partWidth,
1240c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partHeight);
1250c1bc742181ded4930842b46e9507372f0b1b963James Dong
1260c1bc742181ded4930842b46e9507372f0b1b963James Dongvoid h264bsdInterpolateVerQuarter(
1270c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *ref,
1280c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *mb,
1290c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 x0,
1300c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 y0,
1310c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 width,
1320c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 height,
1330c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partWidth,
1340c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partHeight,
1350c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 verOffset);
1360c1bc742181ded4930842b46e9507372f0b1b963James Dong
1370c1bc742181ded4930842b46e9507372f0b1b963James Dongvoid h264bsdInterpolateHorHalf(
1380c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *ref,
1390c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *mb,
1400c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 x0,
1410c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 y0,
1420c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 width,
1430c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 height,
1440c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partWidth,
1450c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partHeight);
1460c1bc742181ded4930842b46e9507372f0b1b963James Dong
1470c1bc742181ded4930842b46e9507372f0b1b963James Dongvoid h264bsdInterpolateHorQuarter(
1480c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *ref,
1490c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *mb,
1500c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 x0,
1510c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 y0,
1520c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 width,
1530c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 height,
1540c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partWidth,
1550c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partHeight,
1560c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 horOffset);
1570c1bc742181ded4930842b46e9507372f0b1b963James Dong
1580c1bc742181ded4930842b46e9507372f0b1b963James Dongvoid h264bsdInterpolateHorVerQuarter(
1590c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *ref,
1600c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *mb,
1610c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 x0,
1620c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 y0,
1630c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 width,
1640c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 height,
1650c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partWidth,
1660c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partHeight,
1670c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 horVerOffset);
1680c1bc742181ded4930842b46e9507372f0b1b963James Dong
1690c1bc742181ded4930842b46e9507372f0b1b963James Dongvoid h264bsdInterpolateMidHalf(
1700c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *ref,
1710c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *mb,
1720c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 x0,
1730c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 y0,
1740c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 width,
1750c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 height,
1760c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partWidth,
1770c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partHeight);
1780c1bc742181ded4930842b46e9507372f0b1b963James Dong
1790c1bc742181ded4930842b46e9507372f0b1b963James Dongvoid h264bsdInterpolateMidVerQuarter(
1800c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *ref,
1810c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *mb,
1820c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 x0,
1830c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 y0,
1840c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 width,
1850c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 height,
1860c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partWidth,
1870c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partHeight,
1880c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 verOffset);
1890c1bc742181ded4930842b46e9507372f0b1b963James Dong
1900c1bc742181ded4930842b46e9507372f0b1b963James Dongvoid h264bsdInterpolateMidHorQuarter(
1910c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *ref,
1920c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *mb,
1930c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 x0,
1940c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 y0,
1950c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 width,
1960c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 height,
1970c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partWidth,
1980c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 partHeight,
1990c1bc742181ded4930842b46e9507372f0b1b963James Dong  u32 horOffset);
2000c1bc742181ded4930842b46e9507372f0b1b963James Dong
2010c1bc742181ded4930842b46e9507372f0b1b963James Dong
2020c1bc742181ded4930842b46e9507372f0b1b963James Dongvoid h264bsdFillRow7(
2030c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *ref,
2040c1bc742181ded4930842b46e9507372f0b1b963James Dong  u8 *fill,
2050c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 left,
2060c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 center,
2070c1bc742181ded4930842b46e9507372f0b1b963James Dong  i32 right);
2080c1bc742181ded4930842b46e9507372f0b1b963James Dong
2090c1bc742181ded4930842b46e9507372f0b1b963James Dong#endif /* #ifdef H264SWDEC_RECONSTRUCT_H */
2100c1bc742181ded4930842b46e9507372f0b1b963James Dong
211