- else {
- av_bprintf(&header, "__constant float rgb2rgb[9] = {\n");
- av_bprintf(&header, " %.4ff, %.4ff, %.4ff,\n",
- rgb2rgb[0][0], rgb2rgb[0][1], rgb2rgb[0][2]);
- av_bprintf(&header, " %.4ff, %.4ff, %.4ff,\n",
- rgb2rgb[1][0], rgb2rgb[1][1], rgb2rgb[1][2]);
- av_bprintf(&header, " %.4ff, %.4ff, %.4ff};\n",
- rgb2rgb[2][0], rgb2rgb[2][1], rgb2rgb[2][2]);
+ else
+ ff_opencl_print_const_matrix_3x3(&header, "rgb2rgb", rgb2rgb);
+
+
+ luma_src = ff_get_luma_coefficients(ctx->colorspace_in);
+ if (!luma_src) {
+ err = AVERROR(EINVAL);
+ av_log(avctx, AV_LOG_ERROR, "unsupported input colorspace %d (%s)\n",
+ ctx->colorspace_in, av_color_space_name(ctx->colorspace_in));
+ goto fail;