summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTorsten Jager <t.jager@gmx.de>2014-08-30 18:25:10 +0200
committerTorsten Jager <t.jager@gmx.de>2014-08-30 18:25:10 +0200
commit0cfe5441c8f1c4cf66361c054b1b69030063b1d5 (patch)
tree7d4e802145e699a7b9777c28bd7b1cbcfd4d3342 /src
parent0c01db2db4a49a363934b364bf210be1769e5aeb (diff)
downloadxine-lib-0cfe5441c8f1c4cf66361c054b1b69030063b1d5.tar.gz
xine-lib-0cfe5441c8f1c4cf66361c054b1b69030063b1d5.tar.bz2
Add simple deep color support.
After putting this little diff to my old Kaffeine: - - - kaffeine-1.2.2/src/dvb/dvbsi.cpp 2011-04-17 21:17:19.000000000 +0200 + + + kaffeine-1.2.2/src/dvb/dvbsi.cpp 2014-08-24 15:41:08.000000000 +0200 @@ -1206,6 +1206,7 @@ DvbPmtParser::DvbPmtParser(const DvbPmtS case 0x02: // MPEG2 video case 0x10: // MPEG4 video case 0x1b: // H264 video + case 0x24: // H265 video if (videoPid < 0) { videoPid = entry.pid(); } else { I stumbled upon "UHD TV" on Astra 19.2E, 11.406Ghz V, 22000, 2/3, 8-PSK, 0.35, Video PID 255. DSP version? Anyway, my box is far too slow for 3840x2160p50 H.265 10bit :-/
Diffstat (limited to 'src')
-rw-r--r--src/combined/ffmpeg/ff_video_decoder.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c
index 33e3fd17a..6529f4563 100644
--- a/src/combined/ffmpeg/ff_video_decoder.c
+++ b/src/combined/ffmpeg/ff_video_decoder.c
@@ -1055,6 +1055,51 @@ static void ff_setup_rgb2yuy2 (ff_video_decoder_t *this, int pix_fmt) {
"ffmpeg_video_dec: converting %s -> %s yuy2\n", fmt, cm_names[cm]);
}
+#if defined(AV_PIX_FMT_YUV420P9) || defined(AV_PIX_FMT_YUV420P10)
+static void ff_get_deep_color (uint8_t *src, int sstride, uint8_t *dest, int dstride,
+ int width, int height, int sbits, uint8_t *tab) {
+ uint16_t *p = (uint16_t *) src;
+ uint8_t *q = dest;
+ int spad = sstride / 2 - width;
+ int dpad = dstride - width;
+ int i;
+
+ if (sbits == 9) {
+ if (tab) {
+ while (height--) {
+ for (i = width; i; i--)
+ *q++ = tab[(*p++) >> 1];
+ p += spad;
+ q += dpad;
+ }
+ } else {
+ while (height--) {
+ for (i = width; i; i--)
+ *q++ = (*p++) >> 1;
+ p += spad;
+ q += dpad;
+ }
+ }
+ } else if (sbits == 10) {
+ if (tab) {
+ while (height--) {
+ for (i = width; i; i--)
+ *q++ = tab[(*p++) >> 2];
+ p += spad;
+ q += dpad;
+ }
+ } else {
+ while (height--) {
+ for (i = width; i; i--)
+ *q++ = (*p++) >> 2;
+ p += spad;
+ q += dpad;
+ }
+ }
+ }
+}
+#endif
+
static void ff_convert_frame(ff_video_decoder_t *this, vo_frame_t *img, AVFrame *av_frame) {
int y;
uint8_t *dy, *du, *dv, *sy, *su, *sv;
@@ -1078,6 +1123,33 @@ static void ff_convert_frame(ff_video_decoder_t *this, vo_frame_t *img, AVFrame
*/
switch (this->context->pix_fmt) {
+#ifdef AV_PIX_FMT_YUV420P9
+ case AV_PIX_FMT_YUV420P9:
+ /* Y */
+ ff_get_deep_color (av_frame->data[0], av_frame->linesize[0], img->base[0], img->pitches[0],
+ img->width, this->bih.biHeight, 9, this->full2mpeg ? this->ytab : NULL);
+ /* U */
+ ff_get_deep_color (av_frame->data[1], av_frame->linesize[1], img->base[1], img->pitches[1],
+ img->width / 2, this->bih.biHeight / 2, 9, this->full2mpeg ? this->ctab : NULL);
+ /* V */
+ ff_get_deep_color (av_frame->data[2], av_frame->linesize[2], img->base[2], img->pitches[2],
+ img->width / 2, this->bih.biHeight / 2, 9, this->full2mpeg ? this->ctab : NULL);
+ break;
+#endif
+#ifdef AV_PIX_FMT_YUV420P10
+ case AV_PIX_FMT_YUV420P10:
+ /* Y */
+ ff_get_deep_color (av_frame->data[0], av_frame->linesize[0], img->base[0], img->pitches[0],
+ img->width, this->bih.biHeight, 10, this->full2mpeg ? this->ytab : NULL);
+ /* U */
+ ff_get_deep_color (av_frame->data[1], av_frame->linesize[1], img->base[1], img->pitches[1],
+ img->width / 2, this->bih.biHeight / 2, 10, this->full2mpeg ? this->ctab : NULL);
+ /* V */
+ ff_get_deep_color (av_frame->data[2], av_frame->linesize[2], img->base[2], img->pitches[2],
+ img->width / 2, this->bih.biHeight / 2, 10, this->full2mpeg ? this->ctab : NULL);
+ break;
+#endif
+
case PIX_FMT_YUV410P:
yuv9_to_yv12(
/* Y */