1 /*
2 * Copyright(c) 2018 Intel Corporation
3 * SPDX - License - Identifier: BSD - 2 - Clause - Patent
4 */
5 
6 #ifndef EBMCP_H
7 #define EBMCP_H
8 
9 #include "EbMcp_SSE2.h"
10 #include "EbMcp_SSSE3.h"
11 #include "EbMcp_AVX2.h"
12 #include "EbDefinitions.h"
13 #include "EbUtility.h"
14 #include "EbPictureBufferDesc.h"
15 #include "EbPictureControlSet.h"
16 #include "EbSequenceControlSet.h"
17 #include "EbObject.h"
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 #define USE_PRE_COMPUTE             0
23 
24 
25 typedef struct MotionCompensationPredictionContext_s
26 {
27     EbDctor dctor;
28     EB_S16 *motionCompensationIntermediateResultBuf0;            //this 64x64(Y)+32x32(U)+32x32(V) buffer is used to store the MCP intermediate result for ref0.
29     EB_S16 *motionCompensationIntermediateResultBuf1;            //this 64x64(Y)+32x32(U)+32x32(V) buffer is used to store the MCP intermediate result for ref1.
30 
31 	EB_BYTE avcStyleMcpIntermediateResultBuf0;                    // For short filter in MD
32     EB_BYTE avcStyleMcpIntermediateResultBuf1;                    // For short filter in MD
33 
34 #if !USE_PRE_COMPUTE
35     EB_S16 *TwoDInterpolationFirstPassFilterResultBuf;           //this (64+MaxLumaFliterTag-1)x(64+MaxLumaFliterTag-1) buffer is used to store the result of 1st pass filtering of 2D interpolation filter.
36     EB_BYTE avcStyleMcpTwoDInterpolationFirstPassFilterResultBuf; // For short filter in MD
37 #endif
38 
39     EbPictureBufferDesc_t *localReferenceBlockL0;                //used to pre-load reference L0 full pel block in local memory in 16bit mode
40     EbPictureBufferDesc_t *localReferenceBlockL1;                //used to pre-load reference L1 full pel block in local memory in 16bit mode
41     EbPictureBufferDesc_t *localReferenceBlock8BITL0;                //used to pre-load reference L0 full pel block in local memory in 16bit mode
42     EbPictureBufferDesc_t *localReferenceBlock8BITL1;                //used to pre-load reference L1 full pel block in local memory in 16bit mode
43 
44 }MotionCompensationPredictionContext_t;
45 
46 /** InterpolationFilter()
47         is generally defined interpolation filter function.
48         There is a whole group of these functions, each of which corresponds to a particular
49         integer/fractional sample, and the function is indexed in a function pointer array
50         in terms of the fracPosx and fracPosy.
51 
52     @param *refPic (8-bits input)
53         refPic is the pointer to the reference picture data that was chosen by
54         the integer pixel precision MV.
55     @param srcStride (input)
56     @param fracPosx (input)
57         fracPosx is the horizontal fractional position of the predicted sample
58     @param fracPosy (input)
59         fracPosy is the veritcal fractional position of the predicted sample
60     @param puWidth (input)
61     @param puHeight (input)
62     @param *dst (16-bits output)
63         dst is the pointer to the destination where the prediction result will
64         be stored.
65     @param dstStride (input)
66     @param *firstPassIFDst (16-bits input)
67         firstPassIFDst is the pointer to the buffer where the result of the first
68         pass filtering of the 2D interpolation filter will be stored.
69     @param isLast (input)
70         isLast indicates if there is any further filtering (interpolation filtering)
71 		afterwards.
72  */
73 typedef void (*InterpolationFilter)(
74     EB_BYTE               refPic,               //8-bits input parameter, please refer to the detailed explanation above.
75     EB_U32                srcStride,            //input parameter
76     EB_U32                fracPosx,             //input parameter, please refer to the detailed explanation above.
77     EB_U32                fracPosy,             //input parameter, please refer to the detailed explanation above.
78     EB_U32                puWidth,              //input parameter
79     EB_U32                puHeight,             //input parameter
80     EB_S16               *dst,                  //output parameter, please refer to the detailed explanation above.
81     EB_U32                dstStride,            //input parameter
82     EB_S16               *firstPassIFDst,       //input parameter, please refer to the detailed explanation above.
83     EB_BOOL               isLast);              //input parameter, please refer to the detailed explanation above.
84 
85 typedef void (*InterpolationFilterNew)(
86     EB_BYTE               refPic,               //8-bits input parameter, please refer to the detailed explanation above.
87     EB_U32                srcStride,            //input parameter
88     EB_BYTE               dst,                  //output parameter, please refer to the detailed explanation above.
89     EB_U32                dstStride,            //input parameter
90     EB_U32                puWidth,              //input parameter
91     EB_U32                puHeight,             //input parameter
92     EB_S16               *firstPassIFDst);      //input parameter, please refer to the detailed explanation above.
93 
94 typedef void (*InterpolationFilterNew16bit)(
95     EB_U16*               refPic,               //input parameter
96     EB_U32                srcStride,            //input parameter
97     EB_U16*               dst,                  //output parameter, please refer to the detailed explanation above.
98     EB_U32                dstStride,            //input parameter
99     EB_U32                puWidth,              //input parameter
100     EB_U32                puHeight,             //input parameter
101     EB_S16               *firstPassIFDst);      //input parameter, please refer to the detailed explanation above.
102 
103 typedef void (*InterpolationFilterChromaNew16bit)(
104     EB_U16               *refPic,
105     EB_U32                srcStride,
106     EB_U16               *dst,
107     EB_U32                dstStride,
108     EB_U32                puWidth,
109     EB_U32                puHeight,
110     EB_S16               *firstPassIFDst,
111     EB_U32                fracPosx,
112     EB_U32                fracPosy);
113 
114 typedef void (*ChromaFilterOutRaw16bit)(
115     EB_U16               *refPic,
116     EB_U32                srcStride,
117     EB_S16               *dst,
118     EB_U32                puWidth,
119     EB_U32                puHeight,
120     EB_S16               *firstPassIFDst,
121     EB_U32                fracPosx,
122     EB_U32                fracPosy);
123 
124 typedef void (*InterpolationFilterOutRaw)(
125     EB_BYTE               refPic,               //8-bits input parameter, please refer to the detailed explanation above.
126     EB_U32                srcStride,            //input parameter
127     EB_S16               *dst,                  //output parameter, please refer to the detailed explanation above.
128     EB_U32                puWidth,              //input parameter
129     EB_U32                puHeight,             //input parameter
130     EB_S16               *firstPassIFDst);      //input parameter, please refer to the detailed explanation above.
131 
132 typedef void (*InterpolationFilterOutRaw16bit)(
133     EB_U16               *refPic,
134     EB_U32                srcStride,
135     EB_S16               *dst,
136     EB_U32                puWidth,
137     EB_U32                puHeight,
138     EB_S16               *firstPassIFDst);
139 
140 typedef void (*ChromaFilterNew)(
141     EB_BYTE               refPic,
142     EB_U32                srcStride,
143     EB_BYTE               dst,
144     EB_U32                dstStride,
145     EB_U32                puWidth,
146     EB_U32                puHeight,
147     EB_S16               *firstPassIFDst,
148     EB_U32                fracPosx,
149     EB_U32                fracPosy);
150 
151 typedef void (*ChromaFilterOutRaw)(
152     EB_BYTE               refPic,
153     EB_U32                srcStride,
154     EB_S16               *dst,
155     EB_U32                puWidth,
156     EB_U32                puHeight,
157     EB_S16               *firstPassIFDst,
158     EB_U32                fracPosx,
159     EB_U32                fracPosy);
160 
161 typedef void (*sampleBiPredClipping)(
162     EB_U32     puWidth,
163     EB_U32     puHeight,
164     EB_S16    *list0Src,
165     EB_S16    *list1Src,
166     EB_BYTE    dst,
167     EB_U32     dstStride,
168     EB_S32     offset);
169 
170 typedef void (*sampleBiPredClipping16bit)(
171     EB_U32     puWidth,
172     EB_U32     puHeight,
173     EB_S16    *list0Src,
174     EB_S16    *list1Src,
175     EB_U16	  *dst,
176     EB_U32     dstStride);
177 
178 typedef void (*lumaSampleUniPredClipping)(
179     EB_U32     puWidth,
180     EB_U32     puHeight,
181     EB_S16    *src,
182     EB_U32     srcStride,
183     EB_BYTE    dst,
184     EB_U32     dstStride);
185 
186 typedef void (*lumaSampleBiPredClipping)(
187     EB_U32     puWidth,
188     EB_U32     puHeight,
189     EB_S16    *list0Src,
190     EB_U32     list0SrcStride,
191     EB_S16    *list1Src,
192     EB_U32     list1SrcStride,
193     EB_BYTE    dst,
194     EB_U32     dstStride);
195 
196 typedef void (*chromaSampleUniPredClipping)(
197     EB_U32     chromaPuWidth,
198     EB_U32     chromaPuHeight,
199     EB_S16    *cbSrc,
200     EB_U32     cbSrcStride,
201     EB_S16    *crSrc,
202     EB_U32     crSrcStride,
203     EB_BYTE    cbDst,
204     EB_U32     cbDstStride,
205     EB_BYTE    crDst,
206     EB_U32     crDstStride);
207 
208 typedef void (*chromaSampleBiPredClipping)(
209     EB_U32     chromaPuWidth,
210     EB_U32     chromaPuHeight,
211     EB_S16    *list0CbSrc,
212     EB_U32     list0CbSrcStride,
213     EB_S16    *list0CrSrc,
214     EB_U32     list0CrSrcStride,
215     EB_S16    *list1CbSrc,
216     EB_U32     list1CbSrcStride,
217     EB_S16    *list1CrSrc,
218     EB_U32     list1CrSrcStride,
219     EB_BYTE    cbDst,
220     EB_U32     cbDstStride,
221     EB_BYTE    crDst,
222     EB_U32     crDstStride);
223 
224 typedef void (*AvcStyleInterpolationFilter)(
225     EB_BYTE               refPic,
226     EB_U32                srcStride,
227     EB_U32                fracPosx,
228     EB_U32                fracPosy,
229     EB_U32                puWidth,
230     EB_U32                puHeight,
231     EB_BYTE               dst,
232     EB_U32                dstStride,
233     EB_BYTE               firstPassIFDst,
234     EB_BYTE               secondPassIFDst,
235     EB_BOOL               isLast);
236 
237 typedef void (*lumaSampleBiPredAverage)(
238     EB_U32     puWidth,
239     EB_U32     puHeight,
240     EB_BYTE    list0Src,
241     EB_U32     list0SrcDoubleStride,
242     EB_BYTE    list1Src,
243     EB_U32     list1SrcDoubleStride,
244     EB_BYTE    dst,
245     EB_U32     dstDoubleStride);
246 
247 typedef void (*chromaSampleBiPredAverage)(
248     EB_U32     chromaPuWidth,
249     EB_U32     chromaPuHeight,
250     EB_BYTE    list0CbSrc,
251     EB_U32     list0CbSrcDoubleStride,
252     EB_BYTE    list0CrSrc,
253     EB_U32     list0CrSrcDoubleStride,
254     EB_BYTE    list1CbSrc,
255     EB_U32     list1CbSrcDoubleStride,
256     EB_BYTE    list1CrSrc,
257     EB_U32     list1CrSrcDoubleStride,
258     EB_BYTE    cbDst,
259     EB_U32     cbDstDoubleStride,
260     EB_BYTE    crDst,
261     EB_U32     crDstDoubleStride);
262 
263 extern EB_ERRORTYPE MotionCompensationPredictionContextCtor(
264 	MotionCompensationPredictionContext_t  *contextPtr,
265 	EB_U16                                  maxCUWidth,
266     EB_U16                                  maxCUHeight,
267     EB_BOOL                                 is16bit);
268 
269 extern void UniPredHevcInterpolationMd(
270 	EbPictureBufferDesc_t *refPic,
271 	EB_U32                 posX,
272 	EB_U32                 posY,
273 	EB_U32                 puWidth,
274 	EB_U32                 puHeight,
275 	EbPictureBufferDesc_t *dst,
276 	EB_U32                 dstLumaIndex,
277 	EB_U32                 dstChromaIndex,
278 	EB_S16                *tempBuf0,
279 	EB_S16                *tempBuf1,
280 	EB_BOOL				   is16bit,
281 	EB_U32				   componentMask);
282 
283 extern void EncodeUniPredInterpolation(
284     EbPictureBufferDesc_t *refPic,
285     EB_U32                 posX,
286     EB_U32                 posY,
287     EB_U32                 puWidth,
288     EB_U32                 puHeight,
289     EbPictureBufferDesc_t *dst,
290     EB_U32                 dstLumaIndex,
291     EB_U32                 dstChromaIndex,
292     EB_S16                *tempBuf0,
293     EB_S16                *tempBuf1);
294 
295 void UniPredInterpolation16bit(
296     EbPictureBufferDesc_t *fullPelBlock,
297     EbPictureBufferDesc_t *refPic,                  //input parameter, please refer to the detailed explanation above.
298     EB_U32                 posX,                    //input parameter, please refer to the detailed explanation above.
299     EB_U32                 posY,                    //input parameter, please refer to the detailed explanation above.
300     EB_U32                 puWidth,                 //input parameter
301     EB_U32                 puHeight,                //input parameter
302     EbPictureBufferDesc_t *dst,                     //output parameter, please refer to the detailed explanation above.
303     EB_U32                 dstLumaIndex,            //input parameter, please refer to the detailed explanation above.
304     EB_U32                 dstChromaIndex,          //input parameter, please refer to the detailed explanation above.
305     EB_S16                *tempBuf0);                //input parameter, please refer to the detailed explanation above.
306 
307 extern void BiPredHevcInterpolationMd(
308 	EbPictureBufferDesc_t *refPicList0,
309 	EbPictureBufferDesc_t *refPicList1,
310 	EB_U32                 refList0PosX,
311 	EB_U32                 refList0PosY,
312 	EB_U32                 refList1PosX,
313 	EB_U32                 refList1PosY,
314 	EB_U32                 puWidth,
315 	EB_U32                 puHeight,
316 	EbPictureBufferDesc_t *biDst,
317 	EB_U32                 dstLumaIndex,
318 	EB_U32                 dstChromaIndex,
319 	EB_S16                *refList0TempDst,
320 	EB_S16                *refList1TempDst,
321 	EB_S16                *fistPassIFTempDst,
322 	EB_BOOL				   is16Bit,
323 	EB_U32				   componentMask);
324 
325 extern void EncodeBiPredInterpolation(
326     EbPictureBufferDesc_t *refPicList0,
327     EbPictureBufferDesc_t *refPicList1,
328     EB_U32                 refList0PosX,
329     EB_U32                 refList0PosY,
330     EB_U32                 refList1PosX,
331     EB_U32                 refList1PosY,
332     EB_U32                 puWidth,
333     EB_U32                 puHeight,
334     EbPictureBufferDesc_t *biDst,
335     EB_U32                 dstLumaIndex,
336     EB_U32                 dstChromaIndex,
337     EB_S16                *refList0TempDst,
338     EB_S16                *refList1TempDst,
339     EB_S16                *fistPassIFTempDst);
340 
341 void BiPredInterpolation16bit(
342     EbPictureBufferDesc_t *fullPelBlockL0,
343     EbPictureBufferDesc_t *fullPelBlockL1,
344     EB_U32                 refList0PosX,
345     EB_U32                 refList0PosY,
346     EB_U32                 refList1PosX,
347     EB_U32                 refList1PosY,
348     EB_U32                 puWidth,
349     EB_U32                 puHeight,
350     EbPictureBufferDesc_t *biDst,
351     EB_U32                 dstLumaIndex,
352     EB_U32                 dstChromaIndex,
353     EB_S16                *refList0TempDst,
354     EB_S16                *refList1TempDst,
355     EB_S16                *fistPassIFTempDst);
356 
357 extern void GeneratePadding(
358     EB_BYTE  srcPic,
359     EB_U32   srcStride,
360     EB_U32   originalSrcWidth,
361     EB_U32   originalSrcHeight,
362     EB_U32   paddingWidth,
363     EB_U32   paddingHeight);
364 extern void GeneratePadding16Bit(
365 	EB_BYTE  srcPic,
366 	EB_U32   srcStride,
367 	EB_U32   originalSrcWidth,
368 	EB_U32   originalSrcHeight,
369 	EB_U32   paddingWidth,
370 	EB_U32   paddingHeight);
371 extern void PadInputPicture(
372     EB_BYTE  srcPic,
373     EB_U32   srcStride,
374     EB_U32   originalSrcWidth,
375     EB_U32   originalSrcHeight,
376 	EB_U32   padRight,
377 	EB_U32   padBottom);
378 
379 void AvcStyleCopy(
380     EB_BYTE               refPic,
381     EB_U32                srcStride,
382     EB_U32                fracPosx,
383     EB_U32                fracPosy,
384     EB_U32                puWidth,
385     EB_U32                puHeight,
386     EB_BYTE               dst,
387     EB_U32                dstStride,
388     EB_BYTE               firstPassIFDst,
389     EB_BYTE               secondPassIFDst,
390     EB_BOOL               isLast);
391 
392 void EstimateOneDFilterChroma(
393     EB_BYTE               refPic,
394     EB_U32                srcStride,
395     EB_U32                fracPosx,
396     EB_U32                fracPosy,
397     EB_U32                puWidth,
398     EB_U32                puHeight,
399     EB_BYTE               dst,
400     EB_U32                dstStride,
401     EB_BYTE               firstPassIFDst,
402     EB_BYTE               secondPassIFDst,
403     EB_BOOL               isLast);
404 
405 void EstimateTwoDFilterChroma(
406     EB_BYTE               refPic,
407     EB_U32                srcStride,
408     EB_U32                fracPosx,
409     EB_U32                fracPosy,
410     EB_U32                puWidth,
411     EB_U32                puHeight,
412     EB_BYTE               dst,
413     EB_U32                dstStride,
414     EB_BYTE               firstPassIFDst,
415     EB_BYTE               secondPassIFDst,
416     EB_BOOL               isLast);
417 
418 void EstimateLumaInterpolationFilterPosb(
419     EB_BYTE               refPic,
420     EB_U32                srcStride,
421     EB_U32                fracPosx,
422     EB_U32                fracPosy,
423     EB_U32                puWidth,
424     EB_U32                puHeight,
425     EB_BYTE               dst,
426     EB_U32                dstStride,
427     EB_BYTE               firstPassIFDst,
428     EB_BYTE               secondPassIFDst,
429     EB_BOOL               isLast);
430 
431 void EstimateLumaInterpolationFilterPosh(
432     EB_BYTE               refPic,
433     EB_U32                srcStride,
434     EB_U32                fracPosx,
435     EB_U32                fracPosy,
436     EB_U32                puWidth,
437     EB_U32                puHeight,
438     EB_BYTE               dst,
439     EB_U32                dstStride,
440     EB_BYTE               firstPassIFDst,
441     EB_BYTE               secondPassIFDst,
442     EB_BOOL               isLast);
443 
444 void EstimateLumaInterpolationFilterPosj(
445     EB_BYTE               refPic,
446     EB_U32                srcStride,
447     EB_U32                fracPosx,
448     EB_U32                fracPosy,
449     EB_U32                puWidth,
450     EB_U32                puHeight,
451     EB_BYTE               dst,
452     EB_U32                dstStride,
453     EB_BYTE               firstPassIFDst,
454     EB_BYTE               secondPassIFDst,
455     EB_BOOL               isLast);
456 
457 void EstimateLumaInterpolationFilterPosa(
458     EB_BYTE               refPic,
459     EB_U32                srcStride,
460     EB_U32                fracPosx,
461     EB_U32                fracPosy,
462     EB_U32                puWidth,
463     EB_U32                puHeight,
464     EB_BYTE               dst,
465     EB_U32                dstStride,
466     EB_BYTE               firstPassIFDst,
467     EB_BYTE               secondPassIFDst,
468     EB_BOOL               isLast);
469 
470 void EstimateLumaInterpolationFilterPosc(
471     EB_BYTE               refPic,
472     EB_U32                srcStride,
473     EB_U32                fracPosx,
474     EB_U32                fracPosy,
475     EB_U32                puWidth,
476     EB_U32                puHeight,
477     EB_BYTE               dst,
478     EB_U32                dstStride,
479     EB_BYTE               firstPassIFDst,
480     EB_BYTE               secondPassIFDst,
481     EB_BOOL               isLast);
482 
483 void EstimateLumaInterpolationFilterPosd(
484     EB_BYTE               refPic,
485     EB_U32                srcStride,
486     EB_U32                fracPosx,
487     EB_U32                fracPosy,
488     EB_U32                puWidth,
489     EB_U32                puHeight,
490     EB_BYTE               dst,
491     EB_U32                dstStride,
492     EB_BYTE               firstPassIFDst,
493     EB_BYTE               secondPassIFDst,
494     EB_BOOL               isLast);
495 
496 void EstimateLumaInterpolationFilterPose(
497     EB_BYTE               refPic,
498     EB_U32                srcStride,
499     EB_U32                fracPosx,
500     EB_U32                fracPosy,
501     EB_U32                puWidth,
502     EB_U32                puHeight,
503     EB_BYTE               dst,
504     EB_U32                dstStride,
505     EB_BYTE               firstPassIFDst,
506     EB_BYTE               secondPassIFDst,
507     EB_BOOL               isLast);
508 
509 void EstimateLumaInterpolationFilterPosf(
510     EB_BYTE               refPic,
511     EB_U32                srcStride,
512     EB_U32                fracPosx,
513     EB_U32                fracPosy,
514     EB_U32                puWidth,
515     EB_U32                puHeight,
516     EB_BYTE               dst,
517     EB_U32                dstStride,
518     EB_BYTE               firstPassIFDst,
519     EB_BYTE               secondPassIFDst,
520     EB_BOOL               isLast);
521 
522 void EstimateLumaInterpolationFilterPosg(
523     EB_BYTE               refPic,
524     EB_U32                srcStride,
525     EB_U32                fracPosx,
526     EB_U32                fracPosy,
527     EB_U32                puWidth,
528     EB_U32                puHeight,
529     EB_BYTE               dst,
530     EB_U32                dstStride,
531     EB_BYTE               firstPassIFDst,
532     EB_BYTE               secondPassIFDst,
533     EB_BOOL               isLast);
534 
535 void EstimateLumaInterpolationFilterPosi(
536     EB_BYTE               refPic,
537     EB_U32                srcStride,
538     EB_U32                fracPosx,
539     EB_U32                fracPosy,
540     EB_U32                puWidth,
541     EB_U32                puHeight,
542     EB_BYTE               dst,
543     EB_U32                dstStride,
544     EB_BYTE               firstPassIFDst,
545     EB_BYTE               secondPassIFDst,
546     EB_BOOL               isLast);
547 
548 void EstimateLumaInterpolationFilterPosk(
549     EB_BYTE               refPic,
550     EB_U32                srcStride,
551     EB_U32                fracPosx,
552     EB_U32                fracPosy,
553     EB_U32                puWidth,
554     EB_U32                puHeight,
555     EB_BYTE               dst,
556     EB_U32                dstStride,
557     EB_BYTE               firstPassIFDst,
558     EB_BYTE               secondPassIFDst,
559     EB_BOOL               isLast);
560 
561 void EstimateLumaInterpolationFilterPosn(
562     EB_BYTE               refPic,
563     EB_U32                srcStride,
564     EB_U32                fracPosx,
565     EB_U32                fracPosy,
566     EB_U32                puWidth,
567     EB_U32                puHeight,
568     EB_BYTE               dst,
569     EB_U32                dstStride,
570     EB_BYTE               firstPassIFDst,
571     EB_BYTE               secondPassIFDst,
572     EB_BOOL               isLast);
573 
574 void EstimateLumaInterpolationFilterPosp(
575     EB_BYTE               refPic,
576     EB_U32                srcStride,
577     EB_U32                fracPosx,
578     EB_U32                fracPosy,
579     EB_U32                puWidth,
580     EB_U32                puHeight,
581     EB_BYTE               dst,
582     EB_U32                dstStride,
583     EB_BYTE               firstPassIFDst,
584     EB_BYTE               secondPassIFDst,
585     EB_BOOL               isLast);
586 
587 void EstimateLumaInterpolationFilterPosq(
588     EB_BYTE               refPic,
589     EB_U32                srcStride,
590     EB_U32                fracPosx,
591     EB_U32                fracPosy,
592     EB_U32                puWidth,
593     EB_U32                puHeight,
594     EB_BYTE               dst,
595     EB_U32                dstStride,
596     EB_BYTE               firstPassIFDst,
597     EB_BYTE               secondPassIFDst,
598     EB_BOOL               isLast);
599 
600 void EstimateLumaInterpolationFilterPosr(
601     EB_BYTE               refPic,
602     EB_U32                srcStride,
603     EB_U32                fracPosx,
604     EB_U32                fracPosy,
605     EB_U32                puWidth,
606     EB_U32                puHeight,
607     EB_BYTE               dst,
608     EB_U32                dstStride,
609     EB_BYTE               firstPassIFDst,
610     EB_BYTE               secondPassIFDst,
611     EB_BOOL               isLast);
612 
613 void InterlacedBiPredAverageLumaIfResult(
614     EB_U32     puWidth,
615     EB_U32     puHeight,
616     EB_BYTE    list0Src,
617     EB_U32     list0SrcDoubleStride,
618     EB_BYTE    list1Src,
619     EB_U32     list1SrcDoubleStride,
620     EB_BYTE    dst,
621     EB_U32     dstDoubleStride);
622 
623 void InterlacedBiPredAverageChromaIfResult(
624     EB_U32     chromaPuWidth,
625     EB_U32     chromaPuHeight,
626     EB_BYTE    list0CbSrc,
627     EB_U32     list0CbSrcDoubleStride,
628     EB_BYTE    list0CrSrc,
629     EB_U32     list0CrSrcDoubleStride,
630     EB_BYTE    list1CbSrc,
631     EB_U32     list1CbSrcDoubleStride,
632     EB_BYTE    list1CrSrc,
633     EB_U32     list1CrSrcDoubleStride,
634     EB_BYTE    cbDst,
635     EB_U32     cbDstDoubleStride,
636     EB_BYTE    crDst,
637     EB_U32     crDstDoubleStride);
638 
639 
640 void EstimateUniPredInterpolation(
641     EbPictureBufferDesc_t *refPic,
642     EB_U32                 posX,
643     EB_U32                 posY,
644     EB_U32                 puWidth,
645     EB_U32                 puHeight,
646     EbPictureBufferDesc_t *dst,
647     EB_U32                 dstLumaIndex,
648     EB_U32                 dstChromaIndex,
649     EB_BYTE                tempBuf0,
650     EB_BYTE                tempBuf1,
651     EB_BYTE                tempBuf2,
652     EB_U32                 componentMask);
653 
654 
655 // Function Tables (Super-long, declared in EbMcpTables.c)
656 extern const InterpolationFilterNew16bit uniPredLuma16bitIFFunctionPtrArray[EB_ASM_TYPE_TOTAL][16];
657 extern const InterpolationFilterChromaNew16bit uniPredChromaIFFunctionPtrArrayNew16bit[EB_ASM_TYPE_TOTAL][64];
658 extern const InterpolationFilterOutRaw16bit biPredLumaIFFunctionPtrArrayNew16bit[EB_ASM_TYPE_TOTAL][16];
659 extern const ChromaFilterOutRaw16bit biPredChromaIFFunctionPtrArrayNew16bit[EB_ASM_TYPE_TOTAL][64];
660 extern const sampleBiPredClipping biPredClippingFuncPtrArray[EB_ASM_TYPE_TOTAL];
661 
662 extern const InterpolationFilterNew     uniPredLumaIFFunctionPtrArrayNew[EB_ASM_TYPE_TOTAL][16];
663 extern const InterpolationFilterOutRaw  biPredLumaIFFunctionPtrArrayNew[EB_ASM_TYPE_TOTAL][16];
664 extern const ChromaFilterNew            uniPredChromaIFFunctionPtrArrayNew[EB_ASM_TYPE_TOTAL][64];
665 extern const ChromaFilterOutRaw         biPredChromaIFFunctionPtrArrayNew[EB_ASM_TYPE_TOTAL][64];
666 extern const sampleBiPredClipping16bit biPredClipping16bitFuncPtrArray[EB_ASM_TYPE_TOTAL];
667 
668 
669 #ifdef __cplusplus
670 }
671 #endif
672 #endif // EBMCP_H
673