From 6b76e3fb69c9cc8afc40c4755532ee0d49143086 Mon Sep 17 00:00:00 2001
From: John Koleszar <jkoleszar@google.com>
Date: Tue, 25 May 2010 08:33:57 -0400
Subject: [PATCH] examples: use I420 input for encoders

The output of simple_decoder, as well as the default format for the
ivf{enc,dec} tools, is I420. The encoder examples are changed to default
to I420 as well. This is desirable because passing the output of
simple_encoder to simple_decoder would otherwise have the chroma planes
flipped, which is unexpected.

Change-Id: I9d4f10ace594a54a7fc4f9a1f9187365c01fd638
---
 examples/encoder_tmpl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/examples/encoder_tmpl.c b/examples/encoder_tmpl.c
index 65473d1ab3..7b33e2b7c6 100644
--- a/examples/encoder_tmpl.c
+++ b/examples/encoder_tmpl.c
@@ -127,7 +127,7 @@ int main(int argc, char **argv) {
     height = strtol(argv[2], NULL, 0);
     if(width < 16 || width%2 || height <16 || height%2)
         die("Invalid resolution: %ldx%ld", width, height);
-    if(!vpx_img_alloc(&raw, VPX_IMG_FMT_YV12, width, height, 1))
+    if(!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, width, height, 1))
         die("Faile to allocate image", width, height);
     if(!(outfile = fopen(argv[4], "wb")))
         die("Failed to open %s for writing", argv[4]);
-- 
GitLab