]> granicus.if.org Git - libvpx/commitdiff
Enforce the use of profile 1 for non-420 content.
authorAlex Converse <aconverse@google.com>
Mon, 27 Jan 2014 19:23:08 +0000 (11:23 -0800)
committerAlex Converse <aconverse@google.com>
Mon, 27 Jan 2014 19:23:08 +0000 (11:23 -0800)
Change-Id: I297954b16bce9e23931331520eadfb47540ff660

vp9/encoder/vp9_onyx_if.c

index 1852d1ea0973c45c206fe09ecfeb1e147e1add39..88023513a4175fc9357905c81c40433d3f48e384 100644 (file)
@@ -3315,6 +3315,7 @@ int vp9_receive_raw_frame(VP9_PTR ptr, unsigned int frame_flags,
                           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;
@@ -3328,6 +3329,12 @@ int vp9_receive_raw_frame(VP9_PTR ptr, unsigned int frame_flags,
   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;
 }