Fix for raw yuv input

Sets fmt correctly for raw yuv inputs, and reads frame
correctly.

Change-Id: I05405b2265545d5c6d1cf7b086db9548cbe5d8ba
This commit is contained in:
Deb Mukherjee
2014-07-11 15:42:39 -07:00
parent cba05a9ecb
commit 78df9ead21
2 changed files with 3 additions and 1 deletions

View File

@@ -83,6 +83,7 @@ int read_yuv_frame(struct VpxInputContext *input_ctx, vpx_image_t *yuv_frame) {
struct FileTypeDetectionBuffer *detect = &input_ctx->detect;
int plane = 0;
int shortread = 0;
const int bytespp = (input_ctx->fmt & VPX_IMG_FMT_HIGH) ? 2 : 1;
for (plane = 0; plane < 3; ++plane) {
uint8_t *ptr;
@@ -108,7 +109,7 @@ int read_yuv_frame(struct VpxInputContext *input_ctx, vpx_image_t *yuv_frame) {
}
for (r = 0; r < h; ++r) {
size_t needed = w;
size_t needed = w * bytespp;
size_t buf_position = 0;
const size_t left = detect->buf_read - detect->position;
if (left > 0) {

View File

@@ -1970,6 +1970,7 @@ int main(int argc, const char **argv_) {
else if (stream->config.cfg.g_bit_depth == VPX_BITS_12)
input.bit_depth = stream->config.cfg.g_in_bit_depth = 12;
});
if (input.bit_depth > 8) input.fmt |= VPX_IMG_FMT_HIGH;
} else {
FOREACH_STREAM({
stream->config.cfg.g_in_bit_depth = input.bit_depth;