+static av_always_inline void sprite_v_template(uint8_t *dst,
+ const uint8_t *src1a,
+ const uint8_t *src1b,
+ int offset1,
+ int two_sprites,
+ const uint8_t *src2a,
+ const uint8_t *src2b,
+ int offset2,
+ int alpha, int scaled,
+ int width)
+{
+ int a1, b1, a2, b2;
+ while (width--) {
+ a1 = *src1a++;
+ if (scaled) {
+ b1 = *src1b++;
+ a1 = a1 + ((b1 - a1) * offset1 >> 16);
+ }
+ if (two_sprites) {
+ a2 = *src2a++;
+ if (scaled > 1) {
+ b2 = *src2b++;
+ a2 = a2 + ((b2 - a2) * offset2 >> 16);
+ }
+ a1 = a1 + ((a2 - a1) * alpha >> 16);
+ }
+ *dst++ = a1;
+ }
+}
+
+static void sprite_v_single_c(uint8_t *dst, const uint8_t *src1a,
+ const uint8_t *src1b,
+ int offset, int width)
+{
+ sprite_v_template(dst, src1a, src1b, offset, 0, NULL, NULL, 0, 0, 1, width);
+}
+
+static void sprite_v_double_noscale_c(uint8_t *dst, const uint8_t *src1a,
+ const uint8_t *src2a,
+ int alpha, int width)
+{
+ sprite_v_template(dst, src1a, NULL, 0, 1, src2a, NULL, 0, alpha, 0, width);
+}
+
+static void sprite_v_double_onescale_c(uint8_t *dst,
+ const uint8_t *src1a,
+ const uint8_t *src1b,
+ int offset1,
+ const uint8_t *src2a,
+ int alpha, int width)
+{
+ sprite_v_template(dst, src1a, src1b, offset1, 1, src2a, NULL, 0, alpha, 1,
+ width);
+}
+
+static void sprite_v_double_twoscale_c(uint8_t *dst,
+ const uint8_t *src1a,
+ const uint8_t *src1b,
+ int offset1,
+ const uint8_t *src2a,
+ const uint8_t *src2b,
+ int offset2,
+ int alpha,
+ int width)
+{
+ sprite_v_template(dst, src1a, src1b, offset1, 1, src2a, src2b, offset2,
+ alpha, 2, width);
+}
+
+#endif /* CONFIG_WMV3IMAGE_DECODER || CONFIG_VC1IMAGE_DECODER */
+
+av_cold void ff_vc1dsp_init(VC1DSPContext *dsp)
+{
+ dsp->vc1_inv_trans_8x8 = vc1_inv_trans_8x8_c;
+ dsp->vc1_inv_trans_4x8 = vc1_inv_trans_4x8_c;
+ dsp->vc1_inv_trans_8x4 = vc1_inv_trans_8x4_c;
+ dsp->vc1_inv_trans_4x4 = vc1_inv_trans_4x4_c;