[FFmpeg-devel] [PATCH] libutvideo: Add ULH0 and ULH2 decoding when using version 13.0.1
Michael Niedermayer
michaelni at gmx.at
Sun Jun 9 10:57:20 CEST 2013
On Thu, Jun 06, 2013 at 08:49:55PM -0400, Stephen Hutchinson wrote:
> ---
> libavcodec/libutvideo.h | 11 ++++++++++-
> libavcodec/libutvideodec.cpp | 13 ++++++++++++-
> libavcodec/libutvideoenc.cpp | 3 ++-
> libavformat/riff.c | 3 +++
> 4 files changed, 27 insertions(+), 3 deletions(-)
>
> diff --git a/libavcodec/libutvideo.h b/libavcodec/libutvideo.h
> index b35d19c..5fb1174 100644
> --- a/libavcodec/libutvideo.h
> +++ b/libavcodec/libutvideo.h
> @@ -21,7 +21,8 @@
> /**
> * @file
> * Known FOURCCs:
> - * 'ULY0' (YCbCr 4:2:0), 'ULY2' (YCbCr 4:2:2), 'ULRG' (RGB), 'ULRA' (RGBA)
> + * 'ULY0' (YCbCr 4:2:0), 'ULY2' (YCbCr 4:2:2), 'ULRG' (RGB), 'ULRA' (RGBA),
> + * 'ULH0' (YCbCr 4:2:0 BT.709), 'ULH2' (YCbCr 4:2:2 BT.709)
> */
>
> #ifndef AVCODEC_LIBUTVIDEO_H
> @@ -45,6 +46,14 @@
> #define UTVF_NFCC_BGRA_BU UTVF_RGB32_WIN
> #endif
>
> +/*
> + * Ut Video version 13.0.1 introduced new BT.709 variants.
> + * Special-case these and only use them if v13 is detected.
> + */
> +#if defined(UTVF_HDYC)
> +#define UTV_BT709
> +#endif
> +
> typedef struct {
> uint32_t version;
> uint32_t original_format;
> diff --git a/libavcodec/libutvideodec.cpp b/libavcodec/libutvideodec.cpp
> index bc491e2..5db7d36 100644
> --- a/libavcodec/libutvideodec.cpp
> +++ b/libavcodec/libutvideodec.cpp
> @@ -21,7 +21,8 @@
> /**
> * @file
> * Known FOURCCs:
> - * 'ULY0' (YCbCr 4:2:0), 'ULY2' (YCbCr 4:2:2), 'ULRG' (RGB), 'ULRA' (RGBA)
> + * 'ULY0' (YCbCr 4:2:0), 'ULY2' (YCbCr 4:2:2), 'ULRG' (RGB), 'ULRA' (RGBA),
> + * 'ULH0' (YCbCr 4:2:0 BT.709), 'ULH2' (YCbCr 4:2:2 BT.709)
> */
>
> extern "C" {
> @@ -51,6 +52,16 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx)
>
> /* Pick format based on FOURCC */
> switch (avctx->codec_tag) {
> +#ifdef UTV_BT709
> + case MKTAG('U', 'L', 'H', '0'):
> + avctx->pix_fmt = AV_PIX_FMT_YUV420P;
> + format = UTVF_YV12;
> + break;
> + case MKTAG('U', 'L', 'H', '2'):
> + avctx->pix_fmt = AV_PIX_FMT_YUYV422;
> + format = UTVF_YUY2;
> + break;
> +#endif
> case MKTAG('U', 'L', 'Y', '0'):
> avctx->pix_fmt = AV_PIX_FMT_YUV420P;
> format = UTVF_YV12;
some of the AVColor fields in AVCodecContext should be set,
otherwise patch should be fine
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130609/b6ce58e2/attachment.asc>
More information about the ffmpeg-devel
mailing list