shithub: libvpx

Download patch

ref: 54ba75a5eed2e6f15146b276e20cca4072f8fda3
parent: c0856b98ccec175a8dd211f6c64bb2b64ee161e7
parent: 321f0ee272349b66535b56e0b10cf753755f1bd8
author: Alex Converse <aconverse@google.com>
date: Thu Jan 30 06:01:53 EST 2014

Merge "Enforce the use of profile 1 for non-420 content."

--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -3330,6 +3330,7 @@
                           YV12_BUFFER_CONFIG *sd, int64_t time_stamp,
                           int64_t end_time) {
   VP9_COMP              *cpi = (VP9_COMP *) ptr;
+  VP9_COMMON             *cm = &cpi->common;
   struct vpx_usec_timer  timer;
   int                    res = 0;
   const int    subsampling_x = sd->uv_width  < sd->y_width;
@@ -3342,6 +3343,12 @@
     res = -1;
   vpx_usec_timer_mark(&timer);
   cpi->time_receive_data += vpx_usec_timer_elapsed(&timer);
+
+  if (cm->version == 0 && (subsampling_x != 1 || subsampling_y != 1)) {
+    vpx_internal_error(&cm->error, VPX_CODEC_INVALID_PARAM,
+                       "Non-4:2:0 color space requires profile >= 1");
+    res = -1;
+  }
 
   return res;
 }