third_party/libyuv/source/convert.cc
// Any I4xx To I420 format with mirroring.
Any I4xx To I420 format with mirroring.
Any I4xx To I420 format with mirroring .
static int I4xxToI420(const uint8_t* src_y,
                      int src_stride_y,
                      const uint8_t* src_u,
                      int src_stride_u,
                      const uint8_t* src_v,
                      int src_stride_v,
                      uint8_t* dst_y,
                      int dst_stride_y,
                      uint8_t* dst_u,
                      int dst_stride_u,
                      uint8_t* dst_v,
                      int dst_stride_v,
                      int src_y_width,
                      int src_y_height,
                      int src_uv_width,
                      int src_uv_height) {
  const int dst_y_width = Abs(src_y_width);
  const int dst_y_height = Abs(src_y_height);
  const int dst_uv_width = SUBSAMPLE(dst_y_width, 1, 1);
  const int dst_uv_height = SUBSAMPLE(dst_y_height, 1, 1);
  if (src_uv_width == 0 || src_uv_height == 0) {
    return -1;
  }
  if (dst_y) {
    ScalePlane(src_y, src_stride_y, src_y_width, src_y_height, dst_y,
               dst_stride_y, dst_y_width, dst_y_height, kFilterBilinear);
  }
  ScalePlane(src_u, src_stride_u, src_uv_width, src_uv_height, dst_u,
             dst_stride_u, dst_uv_width, dst_uv_height, kFilterBilinear);
  ScalePlane(src_v, src_stride_v, src_uv_width, src_uv_height, dst_v,
             dst_stride_v, dst_uv_width, dst_uv_height, kFilterBilinear);
  return 0;
}
static int I4xxToI420 ( const uint8_t * src_y , int src_stride_y , const uint8_t * src_u , int src_stride_u , const uint8_t * src_v , int src_stride_v , uint8_t * dst_y , int dst_stride_y , uint8_t * dst_u , int dst_stride_u , uint8_t * dst_v , int dst_stride_v , int src_y_width , int src_y_height , int src_uv_width , int src_uv_height ) { const int dst_y_width = Abs ( src_y_width ) ; const int dst_y_height = Abs ( src_y_height ) ; const int dst_uv_width = SUBSAMPLE ( dst_y_width , 1 , 1 ) ; const int dst_uv_height = SUBSAMPLE ( dst_y_height , 1 , 1 ) ; if ( src_uv_width == 0 || src_uv_height == 0 ) { return -1 ; } if ( dst_y ) { ScalePlane ( src_y , src_stride_y , src_y_width , src_y_height , dst_y , dst_stride_y , dst_y_width , dst_y_height , kFilterBilinear ) ; } ScalePlane ( src_u , src_stride_u , src_uv_width , src_uv_height , dst_u , dst_stride_u , dst_uv_width , dst_uv_height , kFilterBilinear ) ; ScalePlane ( src_v , src_stride_v , src_uv_width , src_uv_height , dst_v , dst_stride_v , dst_uv_width , dst_uv_height , kFilterBilinear ) ; return 0 ; }
Any I4xx To I420 format with mirroring.
Any I4xx To I420 format with mirroring .