third_party/libyuv/source/planar_functions.cc
// Mirror a plane of data.
Mirror a plane of data.
Mirror a plane of data .
void MirrorPlane(const uint8_t* src_y,
                 int src_stride_y,
                 uint8_t* dst_y,
                 int dst_stride_y,
                 int width,
                 int height) {
  int y;
  void (*MirrorRow)(const uint8_t* src, uint8_t* dst, int width) = MirrorRow_C;
  if (height < 0) {
    height = -height;
    src_y = src_y + (height - 1) * src_stride_y;
    src_stride_y = -src_stride_y;
  }
#if defined(HAS_MIRRORROW_NEON)
  if (TestCpuFlag(kCpuHasNEON)) {
    MirrorRow = MirrorRow_Any_NEON;
    if (IS_ALIGNED(width, 16)) {
      MirrorRow = MirrorRow_NEON;
    }
  }
#endif
#if defined(HAS_MIRRORROW_SSSE3)
  if (TestCpuFlag(kCpuHasSSSE3)) {
    MirrorRow = MirrorRow_Any_SSSE3;
    if (IS_ALIGNED(width, 16)) {
      MirrorRow = MirrorRow_SSSE3;
    }
  }
#endif
#if defined(HAS_MIRRORROW_AVX2)
  if (TestCpuFlag(kCpuHasAVX2)) {
    MirrorRow = MirrorRow_Any_AVX2;
    if (IS_ALIGNED(width, 32)) {
      MirrorRow = MirrorRow_AVX2;
    }
  }
#endif
#if defined(HAS_MIRRORROW_MSA)
  if (TestCpuFlag(kCpuHasMSA)) {
    MirrorRow = MirrorRow_Any_MSA;
    if (IS_ALIGNED(width, 64)) {
      MirrorRow = MirrorRow_MSA;
    }
  }
#endif
  for (y = 0; y < height; ++y) {
    MirrorRow(src_y, dst_y, width);
    src_y += src_stride_y;
    dst_y += dst_stride_y;
  }
}
void MirrorPlane ( const uint8_t * src_y , int src_stride_y , uint8_t * dst_y , int dst_stride_y , int width , int height ) { int y ; void ( * MirrorRow ) ( const uint8_t * src , uint8_t * dst , int width ) = MirrorRow_C ; if ( height < 0 ) { height = - height ; src_y = src_y + ( height - 1 ) * src_stride_y ; src_stride_y = - src_stride_y ; } #if defined ( HAS_MIRRORROW_NEON ) if ( TestCpuFlag ( kCpuHasNEON ) ) { MirrorRow = MirrorRow_Any_NEON ; if ( IS_ALIGNED ( width , 16 ) ) { MirrorRow = MirrorRow_NEON ; } } #endif #if defined ( HAS_MIRRORROW_SSSE3 ) if ( TestCpuFlag ( kCpuHasSSSE3 ) ) { MirrorRow = MirrorRow_Any_SSSE3 ; if ( IS_ALIGNED ( width , 16 ) ) { MirrorRow = MirrorRow_SSSE3 ; } } #endif #if defined ( HAS_MIRRORROW_AVX2 ) if ( TestCpuFlag ( kCpuHasAVX2 ) ) { MirrorRow = MirrorRow_Any_AVX2 ; if ( IS_ALIGNED ( width , 32 ) ) { MirrorRow = MirrorRow_AVX2 ; } } #endif #if defined ( HAS_MIRRORROW_MSA ) if ( TestCpuFlag ( kCpuHasMSA ) ) { MirrorRow = MirrorRow_Any_MSA ; if ( IS_ALIGNED ( width , 64 ) ) { MirrorRow = MirrorRow_MSA ; } } #endif for ( y = 0 ; y < height ; ++ y ) { MirrorRow ( src_y , dst_y , width ) ; src_y += src_stride_y ; dst_y += dst_stride_y ; } }
Mirror a plane of data.
Mirror a plane of data .
// Negative height means invert the image. // Mirror plane