aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-06 19:47:34 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-06 19:56:52 +0100
commit22f59a8cbeb104ccfbc46834fe3afab968281909 (patch)
tree6a3a4df714520e517e7fabb482e82026021336c7 /libavcodec
parent49a5912440db2925a2d4d0a89ad03f882a6e4ca1 (diff)
downloadffmpeg-22f59a8cbeb104ccfbc46834fe3afab968281909.tar.gz
avcodec/huffyuv: add GBRP support
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/huffyuvdec.c3
-rw-r--r--libavcodec/huffyuvenc.c6
2 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index b88e683ca2..383b0f0122 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -364,6 +364,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
&s->chroma_v_shift);
} else {
switch ( (s->chroma<<10) | (s->yuv<<9) | (s->alpha<<8) | ((s->bps-1)<<4) | s->chroma_h_shift | (s->chroma_v_shift<<2)) {
+ case 0x470:
+ avctx->pix_fmt = AV_PIX_FMT_GBRP;
+ break;
case 0x670:
avctx->pix_fmt = AV_PIX_FMT_YUV444P;
break;
diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c
index fd6394474e..d8827cfa4b 100644
--- a/libavcodec/huffyuvenc.c
+++ b/libavcodec/huffyuvenc.c
@@ -186,6 +186,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
case AV_PIX_FMT_YUV410P:
case AV_PIX_FMT_YUV411P:
case AV_PIX_FMT_YUV440P:
+ case AV_PIX_FMT_GBRP:
s->version = 3;
break;
case AV_PIX_FMT_RGB32:
@@ -200,7 +201,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
}
avctx->bits_per_coded_sample = s->bitstream_bpp;
- s->decorrelate = s->bitstream_bpp >= 24 && !s->yuv;
+ s->decorrelate = s->bitstream_bpp >= 24 && !s->yuv && avctx->pix_fmt != AV_PIX_FMT_GBRP;
s->predictor = avctx->prediction_method;
s->interlaced = avctx->flags&CODEC_FLAG_INTERLACED_ME ? 1 : 0;
if (avctx->context_model == 1) {
@@ -720,7 +721,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
encode_bgra_bitstream(s, width, 3);
}
- } else if (s->yuv) {
+ } else if (s->version > 2) {
int plane;
for (plane = 0; plane < 1 + 2*s->chroma + s->alpha; plane++) {
int left, y;
@@ -856,6 +857,7 @@ AVCodec ff_ffvhuff_encoder = {
.pix_fmts = (const enum AVPixelFormat[]){
AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV411P,
AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
+ AV_PIX_FMT_GBRP,
AV_PIX_FMT_RGB24,
AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE
},