mirror of https://git.ffmpeg.org/ffmpeg.git
sws: move initializing dither_error higher up
It does not interact in any way with the code setting up the image pointers/strides, so it should not be intermixed with it.
This commit is contained in:
parent
e188985598
commit
d6649d9a3b
|
@ -907,6 +907,10 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
|
||||||
if (c->cascaded_context[0] && srcSliceY == 0 && srcSliceH == c->cascaded_context[0]->srcH)
|
if (c->cascaded_context[0] && srcSliceY == 0 && srcSliceH == c->cascaded_context[0]->srcH)
|
||||||
return scale_cascaded(c, srcSlice, srcStride, srcSliceY, srcSliceH, dst, dstStride);
|
return scale_cascaded(c, srcSlice, srcStride, srcSliceY, srcSliceH, dst, dstStride);
|
||||||
|
|
||||||
|
if (!srcSliceY && (c->flags & SWS_BITEXACT) && c->dither == SWS_DITHER_ED && c->dither_error[0])
|
||||||
|
for (i = 0; i < 4; i++)
|
||||||
|
memset(c->dither_error[i], 0, sizeof(c->dither_error[0][0]) * (c->dstW+2));
|
||||||
|
|
||||||
memcpy(src2, srcSlice, sizeof(src2));
|
memcpy(src2, srcSlice, sizeof(src2));
|
||||||
memcpy(dst2, dst, sizeof(dst2));
|
memcpy(dst2, dst, sizeof(dst2));
|
||||||
memcpy(srcStride2, srcStride, sizeof(srcStride2));
|
memcpy(srcStride2, srcStride, sizeof(srcStride2));
|
||||||
|
@ -959,10 +963,6 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
|
||||||
src2[0] = base;
|
src2[0] = base;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!srcSliceY && (c->flags & SWS_BITEXACT) && c->dither == SWS_DITHER_ED && c->dither_error[0])
|
|
||||||
for (i = 0; i < 4; i++)
|
|
||||||
memset(c->dither_error[i], 0, sizeof(c->dither_error[0][0]) * (c->dstW+2));
|
|
||||||
|
|
||||||
if (c->sliceDir != 1) {
|
if (c->sliceDir != 1) {
|
||||||
// slices go from bottom to top => we flip the image internally
|
// slices go from bottom to top => we flip the image internally
|
||||||
for (i=0; i<4; i++) {
|
for (i=0; i<4; i++) {
|
||||||
|
|
Loading…
Reference in New Issue