186 {
188 switch (
src.yuvaInfo().planeConfig()) {
190 auto [ssWidthU, ssHeightU] =
src.yuvaInfo().planeSubsamplingFactors(1);
191 auto [ssWidthV, ssHeightV] =
src.yuvaInfo().planeSubsamplingFactors(2);
192 const uint8_t* srcY =
reinterpret_cast<const uint8_t*
>(
src.plane(0).addr(0, row));
193 const uint8_t* srcU =
194 reinterpret_cast<const uint8_t*
>(
src.plane(1).addr(0, row / ssHeightU));
195 const uint8_t* srcV =
196 reinterpret_cast<const uint8_t*
>(
src.plane(2).addr(0, row / ssHeightV));
197 for (
int col = 0; col <
width; ++col) {
198 dst[3 * col + 0] = srcY[col];
199 dst[3 * col + 1] = srcU[col / ssWidthU];
200 dst[3 * col + 2] = srcV[col / ssWidthV];
201 }
202 break;
203 }
205 auto [ssWidthUV, ssHeightUV] =
src.yuvaInfo().planeSubsamplingFactors(1);
206 const uint8_t* srcY =
reinterpret_cast<const uint8_t*
>(
src.plane(0).addr(0, row));
207 const uint8_t* srcUV =
208 reinterpret_cast<const uint8_t*
>(
src.plane(1).addr(0, row / ssHeightUV));
209 for (
int col = 0; col <
width; ++col) {
210 dst[3 * col + 0] = srcY[col];
211 dst[3 * col + 1] = srcUV[2 * (col / ssWidthUV) + 0];
212 dst[3 * col + 2] = srcUV[2 * (col / ssWidthUV) + 1];
213 }
214 break;
215 }
216 default:
217 break;
218 }
219}
@ kY_U_V
Plane 0: Y, Plane 1: U, Plane 2: V.
@ kY_UV
Plane 0: Y, Plane 1: UV.