int height= (plane==0 || plane==3) ? srcSliceH: -((-srcSliceH)>>c->chrDstVSubSample);
const uint8_t *srcPtr= src[plane];
uint8_t *dstPtr= dst[plane] + dstStride[plane]*y;
+ int shiftonly= plane==1 || plane==2 || (!c->srcRange && plane==0);
if (!dst[plane]) continue;
// ignore palette for GRAY8
}
} else if (src_depth == 8) {
for (i = 0; i < height; i++) {
+ #define COPY816(w)\
+ if(shiftonly){\
+ for (j = 0; j < length; j++)\
+ w(&dstPtr2[j], srcPtr[j]<<(dst_depth-8));\
+ }else{\
+ for (j = 0; j < length; j++)\
+ w(&dstPtr2[j], (srcPtr[j]<<(dst_depth-8)) |\
+ (srcPtr[j]>>(2*8-dst_depth)));\
+ }
if(isBE(c->dstFormat)){
- for (j = 0; j < length; j++)
- AV_WB16(&dstPtr2[j], (srcPtr[j]<<(dst_depth-8)) |
- (srcPtr[j]>>(2*8-dst_depth)));
+ COPY816(AV_WB16)
} else {
- for (j = 0; j < length; j++)
- AV_WL16(&dstPtr2[j], (srcPtr[j]<<(dst_depth-8)) |
- (srcPtr[j]>>(2*8-dst_depth)));
+ COPY816(AV_WL16)
}
dstPtr2 += dstStride[plane]/2;
srcPtr += srcStride[plane];
} else if (src_depth <= dst_depth) {
for (i = 0; i < height; i++) {
#define COPY_UP(r,w) \
- for (j = 0; j < length; j++){ \
- unsigned int v= r(&srcPtr2[j]);\
- w(&dstPtr2[j], (v<<(dst_depth-src_depth)) | \
- (v>>(2*src_depth-dst_depth)));\
+ if(shiftonly){\
+ for (j = 0; j < length; j++){ \
+ unsigned int v= r(&srcPtr2[j]);\
+ w(&dstPtr2[j], v<<(dst_depth-src_depth));\
+ }\
+ }else{\
+ for (j = 0; j < length; j++){ \
+ unsigned int v= r(&srcPtr2[j]);\
+ w(&dstPtr2[j], (v<<(dst_depth-src_depth)) | \
+ (v>>(2*src_depth-dst_depth)));\
+ }\
}
if(isBE(c->srcFormat)){
if(isBE(c->dstFormat)){
{
if(!isALPHA(format))
src[3]=NULL;
- if(!isPlanarYUV(format)) {
+ if(!isPlanar(format)) {
src[3]=src[2]=NULL;
if (!usePal(format))
int dstStride2[4]= {dstStride[0], dstStride[1], dstStride[2], dstStride[3]};
reset_ptr(src2, c->srcFormat);
- reset_ptr((const uint8_t**)dst2, c->dstFormat);
+ reset_ptr((void*)dst2, c->dstFormat);
/* reset slice direction at end of frame */
if (srcSliceY + srcSliceH == c->srcH)