#include "libavutil/avutil.h"
#include "libavutil/bswap.h"
#include "libavutil/cpu.h"
+#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/pixdesc.h"
c->xyz2rgb_matrix[2][2] * z >> 12;
// limit values to 12-bit depth
- r = av_clip_c(r,0,4095);
- g = av_clip_c(g,0,4095);
- b = av_clip_c(b,0,4095);
+ r = av_clip(r, 0, 4095);
+ g = av_clip(g, 0, 4095);
+ b = av_clip(b, 0, 4095);
// convert from sRGBlinear to RGB and scale from 12bit to 16bit
if (desc->flags & AV_PIX_FMT_FLAG_BE) {
c->rgb2xyz_matrix[2][2] * b >> 12;
// limit values to 12-bit depth
- x = av_clip_c(x,0,4095);
- y = av_clip_c(y,0,4095);
- z = av_clip_c(z,0,4095);
+ x = av_clip(x, 0, 4095);
+ y = av_clip(y, 0, 4095);
+ z = av_clip(z, 0, 4095);
// convert from XYZlinear to X'Y'Z' and scale from 12bit to 16bit
if (desc->flags & AV_PIX_FMT_FLAG_BE) {
av_log(c, AV_LOG_ERROR, "One of the input parameters to sws_scale() is NULL, please check the calling code\n");
return 0;
}
+ if (c->cascaded_context[0] && srcSliceY == 0 && srcSliceH == c->cascaded_context[0]->srcH) {
+ ret = sws_scale(c->cascaded_context[0],
+ srcSlice, srcStride, srcSliceY, srcSliceH,
+ c->cascaded_tmp, c->cascaded_tmpStride);
+ if (ret < 0)
+ return ret;
+ ret = sws_scale(c->cascaded_context[1],
+ (const uint8_t * const * )c->cascaded_tmp, c->cascaded_tmpStride, 0, c->cascaded_context[0]->dstH,
+ dst, dstStride);
+ return ret;
+ }
+
memcpy(src2, srcSlice, sizeof(src2));
memcpy(dst2, dst, sizeof(dst2));