4 * Represents 8 triangles (4 quads, 1 per block) in noormalized coords
5 * that render a macroblock.
6 * Need to be scaled to cover mbW*mbH macroblock pixels and translated into
7 * position on target surface.
9 const struct vlVertex2f macroblock_verts
[24] =
11 {0.0f
, 0.0f
}, {0.0f
, 0.5f
}, {0.5f
, 0.0f
},
12 {0.5f
, 0.0f
}, {0.0f
, 0.5f
}, {0.5f
, 0.5f
},
14 {0.5f
, 0.0f
}, {0.5f
, 0.5f
}, {1.0f
, 0.0f
},
15 {1.0f
, 0.0f
}, {0.5f
, 0.5f
}, {1.0f
, 0.5f
},
17 {0.0f
, 0.5f
}, {0.0f
, 1.0f
}, {0.5f
, 0.5f
},
18 {0.5f
, 0.5f
}, {0.0f
, 1.0f
}, {0.5f
, 1.0f
},
20 {0.5f
, 0.5f
}, {0.5f
, 1.0f
}, {1.0f
, 0.5f
},
21 {1.0f
, 0.5f
}, {0.5f
, 1.0f
}, {1.0f
, 1.0f
}
25 * Represents texcoords for the above for rendering 4 luma blocks arranged
26 * in a bW*(bH*4) texture. First luma block located at 0,0->bW,bH; second at
27 * 0,bH->bW,2bH; third at 0,2bH->bW,3bH; fourth at 0,3bH->bW,4bH.
29 const struct vlVertex2f macroblock_luma_texcoords
[24] =
31 {0.0f
, 0.0f
}, {0.0f
, 0.25f
}, {1.0f
, 0.0f
},
32 {1.0f
, 0.0f
}, {0.0f
, 0.25f
}, {1.0f
, 0.25f
},
34 {0.0f
, 0.25f
}, {0.0f
, 0.5f
}, {1.0f
, 0.25f
},
35 {1.0f
, 0.25f
}, {0.0f
, 0.5f
}, {1.0f
, 0.5f
},
37 {0.0f
, 0.5f
}, {0.0f
, 0.75f
}, {1.0f
, 0.5f
},
38 {1.0f
, 0.5f
}, {0.0f
, 0.75f
}, {1.0f
, 0.75f
},
40 {0.0f
, 0.75f
}, {0.0f
, 1.0f
}, {1.0f
, 0.75f
},
41 {1.0f
, 0.75f
}, {0.0f
, 1.0f
}, {1.0f
, 1.0f
}
45 * Represents texcoords for the above for rendering 1 chroma block.
46 * Straight forward 0,0->1,1 mapping so we can reuse the MB pos vectors.
48 const struct vlVertex2f
*macroblock_chroma_420_texcoords
= macroblock_verts
;
51 * Represents texcoords for the above for rendering 2 chroma blocks arranged
52 * in a bW*(bH*2) texture. First chroma block located at 0,0->bW,bH; second at
53 * 0,bH->bW,2bH. We can render this with 0,0->1,1 mapping.
54 * Straight forward 0,0->1,1 mapping so we can reuse MB pos vectors.
56 const struct vlVertex2f
*macroblock_chroma_422_texcoords
= macroblock_verts
;
59 * Represents texcoords for the above for rendering 4 chroma blocks.
60 * Same case as 4 luma blocks.
62 const struct vlVertex2f
*macroblock_chroma_444_texcoords
= macroblock_luma_texcoords
;
65 * Used when rendering P and B macroblocks, multiplier is applied to the A channel,
66 * which is then added to the L channel, then the bias is subtracted from that to
67 * get back the differential. The differential is then added to the samples from the
68 * reference surface(s).
71 const struct VL_MC_FS_CONSTS vl_mc_fs_consts
=
73 {32767.0f
/ 255.0f
, 32767.0f
/ 255.0f
, 32767.0f
/ 255.0f
, 0.0f
},
74 {0.5f
, 2.0f
, 0.0f
, 0.0f
}