summaryrefslogtreecommitdiff
path: root/libswscale
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-05-10 00:21:18 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-10 00:21:18 +0200
commit42c9bd313f8cf0975e87078ced5a05c17ad45cc5 (patch)
tree39db7505036f251ae80d38f8d413e3fc9e795cc4 /libswscale
parentc4f7050bb1e449a9b45a98cc460c06bd89afa8b4 (diff)
swscale: Support dither in is16BPS(c->srcFormat) && !is16BPS(c->dstFormat)
This is done by just letting the Nbit code handle it, which now can do it. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/swscale.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 744e002b9c..6379bc15ec 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1897,7 +1897,9 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[
length*=2;
fillPlane(dst[plane], dstStride[plane], length, height, y, (plane==3) ? 255 : 128);
} else {
- if(isNBPS(c->srcFormat) || isNBPS(c->dstFormat)) {
+ if(isNBPS(c->srcFormat) || isNBPS(c->dstFormat)
+ || (is16BPS(c->srcFormat) && !is16BPS(c->dstFormat))
+ ) {
const int src_depth = av_pix_fmt_descriptors[c->srcFormat].comp[plane].depth_minus1+1;
const int dst_depth = av_pix_fmt_descriptors[c->dstFormat].comp[plane].depth_minus1+1;
uint16_t *srcPtr2 = (uint16_t*)srcPtr;
@@ -1938,14 +1940,6 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[
DITHER_COPY(dstPtr2, dstStride[plane]/2, srcPtr2, srcStride[plane]/2, av_bswap16)
}
}
- } else if(is16BPS(c->srcFormat) && !is16BPS(c->dstFormat)) {
- //FIXME add dither
- if (!isBE(c->srcFormat)) srcPtr++;
- for (i=0; i<height; i++) {
- for (j=0; j<length; j++) dstPtr[j] = srcPtr[j<<1];
- srcPtr+= srcStride[plane];
- dstPtr+= dstStride[plane];
- }
} else if(!is16BPS(c->srcFormat) && is16BPS(c->dstFormat)) {
for (i=0; i<height; i++) {
for (j=0; j<length; j++) {