lavc: Add data and linesize to AVSubtitleRect

Use the new fields directly instead of the ones from AVPicture.
This removes a layer of indirection which serves no pratical purpose
whatsoever, and will help in removing AVPicture structure completely
later.

Every subtitle encoder/decoder seamlessly points to the new arrays,
so it is possible to deprecate AVSubtitleRect.pict.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
This commit is contained in:
Vittorio Giovara
2015-10-14 11:33:25 +02:00
parent f890677d05
commit a17a766190
12 changed files with 166 additions and 75 deletions

View File

@@ -455,9 +455,9 @@ static void blend_subrect(AVPicture *dst, const AVSubtitleRect *rect, int imgw,
width2 = ((dstw + 1) >> 1) + (dstx & ~dstw & 1);
skip2 = dstx >> 1;
wrap = dst->linesize[0];
wrap3 = rect->pict.linesize[0];
p = rect->pict.data[0];
pal = (const uint32_t *)rect->pict.data[1]; /* Now in YCrCb! */
wrap3 = rect->linesize[0];
p = rect->data[0];
pal = (const uint32_t *)rect->data[1]; /* Now in YCrCb! */
if (dsty & 1) {
lum += dstx;
@@ -1758,11 +1758,11 @@ static int subtitle_thread(void *arg)
{
for (j = 0; j < sp->sub.rects[i]->nb_colors; j++)
{
RGBA_IN(r, g, b, a, (uint32_t*)sp->sub.rects[i]->pict.data[1] + j);
RGBA_IN(r, g, b, a, (uint32_t *)sp->sub.rects[i]->data[1] + j);
y = RGB_TO_Y_CCIR(r, g, b);
u = RGB_TO_U_CCIR(r, g, b, 0);
v = RGB_TO_V_CCIR(r, g, b, 0);
YUVA_OUT((uint32_t*)sp->sub.rects[i]->pict.data[1] + j, y, u, v, a);
YUVA_OUT((uint32_t *)sp->sub.rects[i]->data[1] + j, y, u, v, a);
}
}