|
@@ -24,9 +24,55 @@
|
|
|
#include "libavutil/attributes.h"
|
|
|
#include "libavutil/avassert.h"
|
|
|
#include "libavutil/common.h"
|
|
|
+#include "libavutil/intreadwrite.h"
|
|
|
#include "idctdsp.h"
|
|
|
#include "proresdsp.h"
|
|
|
-#include "simple_idct.h"
|
|
|
+
|
|
|
+#define IN_IDCT_DEPTH 16
|
|
|
+#define PRORES_ONLY
|
|
|
+
|
|
|
+#define BIT_DEPTH 10
|
|
|
+#define EXTRA_SHIFT
|
|
|
+#include "simple_idct_template.c"
|
|
|
+#undef BIT_DEPTH
|
|
|
+#undef EXTRA_SHIFT
|
|
|
+
|
|
|
+#define BIT_DEPTH 12
|
|
|
+#include "simple_idct_template.c"
|
|
|
+#undef BIT_DEPTH
|
|
|
+
|
|
|
+/**
|
|
|
+ * Special version of ff_simple_idct_int16_10bit() which does dequantization
|
|
|
+ * and scales by a factor of 2 more between the two IDCTs to account
|
|
|
+ * for larger scale of input coefficients.
|
|
|
+ */
|
|
|
+static void prores_idct_10(int16_t *restrict block, const int16_t *restrict qmat)
|
|
|
+{
|
|
|
+ for (int i = 0; i < 64; i++)
|
|
|
+ block[i] *= qmat[i];
|
|
|
+
|
|
|
+ for (int i = 0; i < 8; i++)
|
|
|
+ idctRowCondDC_extrashift_10(block + i*8, 2);
|
|
|
+
|
|
|
+ for (int i = 0; i < 8; i++) {
|
|
|
+ block[i] += 8192;
|
|
|
+ idctSparseCol_extrashift_10(block + i);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+static void prores_idct_12(int16_t *restrict block, const int16_t *restrict qmat)
|
|
|
+{
|
|
|
+ for (int i = 0; i < 64; i++)
|
|
|
+ block[i] *= qmat[i];
|
|
|
+
|
|
|
+ for (int i = 0; i < 8; i++)
|
|
|
+ idctRowCondDC_int16_12bit(block + i*8, 0);
|
|
|
+
|
|
|
+ for (int i = 0; i < 8; i++) {
|
|
|
+ block[i] += 8192;
|
|
|
+ idctSparseCol_int16_12bit(block + i);
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
#define CLIP_MIN (1 << 2) ///< minimum value for clipping resulting pixels
|
|
|
#define CLIP_MAX_10 (1 << 10) - CLIP_MIN - 1 ///< maximum value for clipping resulting pixels
|
|
@@ -65,13 +111,13 @@ static void put_pixels_12(uint16_t *dst, ptrdiff_t linesize, const int16_t *in)
|
|
|
|
|
|
static void prores_idct_put_10_c(uint16_t *out, ptrdiff_t linesize, int16_t *block, const int16_t *qmat)
|
|
|
{
|
|
|
- ff_prores_idct_10(block, qmat);
|
|
|
+ prores_idct_10(block, qmat);
|
|
|
put_pixels_10(out, linesize >> 1, block);
|
|
|
}
|
|
|
|
|
|
static void prores_idct_put_12_c(uint16_t *out, ptrdiff_t linesize, int16_t *block, const int16_t *qmat)
|
|
|
{
|
|
|
- ff_prores_idct_12(block, qmat);
|
|
|
+ prores_idct_12(block, qmat);
|
|
|
put_pixels_12(out, linesize >> 1, block);
|
|
|
}
|
|
|
|