X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Fffmpeg%2F0001-Support-raw-dvdsub-palette-as-stored-on-normal-dvd-s.patch;fp=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Fffmpeg%2F0001-Support-raw-dvdsub-palette-as-stored-on-normal-dvd-s.patch;h=a51a7d3c9c480440b8e01c58afb6647b9b7f2c36;hb=b0a0f15dfaa205161a7fcb20cf1b8cd4948c2ef3;hp=0000000000000000000000000000000000000000;hpb=c6ac3cd55ee2da956195eee393b0882105dfad4e;p=packages%2Ftrusty%2Fcirros-testvm.git diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/package/ffmpeg/0001-Support-raw-dvdsub-palette-as-stored-on-normal-dvd-s.patch b/cirros-testvm/src-cirros/buildroot-2015.05/package/ffmpeg/0001-Support-raw-dvdsub-palette-as-stored-on-normal-dvd-s.patch new file mode 100644 index 0000000..a51a7d3 --- /dev/null +++ b/cirros-testvm/src-cirros/buildroot-2015.05/package/ffmpeg/0001-Support-raw-dvdsub-palette-as-stored-on-normal-dvd-s.patch @@ -0,0 +1,63 @@ +From 74f1c9b43b191a9d6b494e90a4a11677fca33c13 Mon Sep 17 00:00:00 2001 +From: Joakim Plate +Date: Sun, 11 Sep 2011 19:04:51 +0200 +Subject: [PATCH 01/13] Support raw dvdsub palette as stored on normal dvd's + +This is how the palette is stored on dvd's. Currently +only xbmc passes the palette information to libavcodec +this way. + +Patch part of the XBMC patch set for ffmpeg, downloaded from +https://github.com/xbmc/FFmpeg/. + +Signed-off-by: Bernd Kuhls +Signed-off-by: Thomas Petazzoni +--- + libavcodec/dvdsubdec.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c +index 39604f3..a711e16 100644 +--- a/libavcodec/dvdsubdec.c ++++ b/libavcodec/dvdsubdec.c +@@ -64,6 +64,24 @@ static void yuv_a_to_rgba(const uint8_t *ycbcr, const uint8_t *alpha, uint32_t * + } + } + ++static void ayvu_to_argb(const uint8_t *ayvu, uint32_t *argb, int num_values) ++{ ++ uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; ++ uint8_t r, g, b; ++ int i, y, cb, cr, a; ++ int r_add, g_add, b_add; ++ ++ for (i = num_values; i > 0; i--) { ++ a = *ayvu++; ++ y = *ayvu++; ++ cr = *ayvu++; ++ cb = *ayvu++; ++ YUV_TO_RGB1_CCIR(cb, cr); ++ YUV_TO_RGB2_CCIR(r, g, b, y); ++ *argb++ = (a << 24) | (r << 16) | (g << 8) | b; ++ } ++} ++ + static int decode_run_2bit(GetBitContext *gb, int *color) + { + unsigned int v, t; +@@ -697,6 +715,12 @@ static av_cold int dvdsub_init(AVCodecContext *avctx) + parse_ifo_palette(ctx, ctx->ifo_str); + if (ctx->palette_str) + parse_palette(ctx, ctx->palette_str); ++ ++ if (!ctx->has_palette && avctx->extradata_size == 64) { ++ ayvu_to_argb((uint8_t*)avctx->extradata, ctx->palette, 16); ++ ctx->has_palette = 1; ++ } ++ + if (ctx->has_palette) { + int i; + av_log(avctx, AV_LOG_DEBUG, "palette:"); +-- +2.1.0 +