Fix for raw yuv input
Sets fmt correctly for raw yuv inputs, and reads frame correctly. Change-Id: I05405b2265545d5c6d1cf7b086db9548cbe5d8ba
This commit is contained in:
@@ -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) {
|
||||
|
1
vpxenc.c
1
vpxenc.c
@@ -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;
|
||||
|
Reference in New Issue
Block a user