summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-09 02:36:16 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-09 02:36:58 +0200
commit3bc86462a2ae1ec03c1a8ada49c70e34a22520e9 (patch)
treebfa053ac435ecf970cac2ad1f50ce4d28728ee88 /libavcodec
parent349a32c436d9511fe786c761cc2728f5b5efea0e (diff)
parent65875a8b3b079752da25a61ec188d2e3d90a569f (diff)
Merge commit '65875a8b3b079752da25a61ec188d2e3d90a569f'
* commit '65875a8b3b079752da25a61ec188d2e3d90a569f': vp8: initialize color space and range properties Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vp8.c12
-rw-r--r--libavcodec/vp8.h3
2 files changed, 13 insertions, 2 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index d72fb57311..147c4f90b5 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -688,9 +688,10 @@ static int vp8_decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_si
buf_size -= header_size;
if (s->keyframe) {
- if (vp8_rac_get(c))
+ s->colorspace = vp8_rac_get(c);
+ if (s->colorspace)
av_log(s->avctx, AV_LOG_WARNING, "Unspecified colorspace\n");
- vp8_rac_get(c); // whether we can skip clamping in dsp functions
+ s->fullrange = vp8_rac_get(c);
}
if ((s->segmentation.enabled = vp8_rac_get(c)))
@@ -2547,6 +2548,13 @@ int vp78_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
curframe = s->framep[VP56_FRAME_CURRENT] = vp8_find_free_buffer(s);
+ if (!s->colorspace)
+ avctx->colorspace = AVCOL_SPC_BT470BG;
+ if (s->fullrange)
+ avctx->color_range = AVCOL_RANGE_JPEG;
+ else
+ avctx->color_range = AVCOL_RANGE_MPEG;
+
/* Given that arithmetic probabilities are updated every frame, it's quite
* likely that the values we have on a random interframe are complete
* junk if we didn't start decode on a keyframe. So just don't display
diff --git a/libavcodec/vp8.h b/libavcodec/vp8.h
index 83729c8b92..b650892735 100644
--- a/libavcodec/vp8.h
+++ b/libavcodec/vp8.h
@@ -266,6 +266,9 @@ typedef struct VP8Context {
vp8_mc_func put_pixels_tab[3][3][3];
VP8Frame frames[5];
+ uint8_t colorspace; ///< 0 is the only value allowed (meaning bt601)
+ uint8_t fullrange; ///< whether we can skip clamping in dsp functions
+
int num_jobs;
/**
* This describes the macroblock memory layout.