@@ -1176,10 +1176,18 @@ void convert_yuv_to_planarrgb_uintN_sse2(BYTE *(&dstp)[3], int (&dstPitch)[3], c
11761176 // ( v3 4096 ) ( v2 4096 ) ( v1 4096 ) ( v0 4096 )
11771177 // res2= (yv_b*v3 + round' ) ... round' = round + rgb_offset
11781178
1179+ // For v141_xp compatibility: forces the compiler to capture a const variable
1180+ // that would otherwise be optimized out of nested lambda scopes.
1181+ #define XP_LAMBDA_CAPTURE_FIX (x ) (void )(x)
1182+
11791183 // Processing lambda - checked and benchmarked to be inlined nicely -avoids code bloat
11801184 auto process_plane_sse2 = [&](BYTE* plane_ptr, __m128i m_uy, __m128i m_vr, __m128i v_patch) {
1185+ XP_LAMBDA_CAPTURE_FIX (zero);
1186+ XP_LAMBDA_CAPTURE_FIX (limit);
1187+ XP_LAMBDA_CAPTURE_FIX (scale_f_sse2);
11811188
11821189 auto madd_shift = [&](__m128i uy, __m128i vr) {
1190+ XP_LAMBDA_CAPTURE_FIX (v_patch);
11831191 __m128i sum = _mm_add_epi32 (_mm_madd_epi16 (m_uy, uy), _mm_madd_epi16 (m_vr, vr));
11841192 // 16-bit adjustment (signed patch, offset, output rgb offset)
11851193 if constexpr (!lessthan16bit) sum = _mm_add_epi32 (sum, v_patch);
@@ -1220,6 +1228,8 @@ void convert_yuv_to_planarrgb_uintN_sse2(BYTE *(&dstp)[3], int (&dstPitch)[3], c
12201228 }
12211229 };
12221230
1231+ #undef XP_LAMBDA_CAPTURE_FIX
1232+
12231233 // Process planes, using pre-packed coefficient, and the 16 bit patch if needed
12241234 process_plane_sse2 (dstp[0 ], m_uy_G, m_vr_G, v_patch_G);
12251235 process_plane_sse2 (dstp[1 ], m_uy_B, m_vr_B, v_patch_B);
0 commit comments