• Home
  • Raw
  • Download

Lines Matching full:matrix

65   /* channel conversion matrix, m[in_channels][out_channels].
66 * If identity matrix, passthrough applies. */
67 gfloat **matrix; member
69 /* channel conversion matrix with int values, m[in_channels][out_channels].
70 * this is matrix * (2^10) as integers */
89 g_free (mix->matrix[i]); in gst_audio_channel_mixer_free()
90 g_free (mix->matrix); in gst_audio_channel_mixer_free()
91 mix->matrix = NULL; in gst_audio_channel_mixer_free()
108 gst_audio_channel_mixer_fill_identical (gfloat ** matrix, in gst_audio_channel_mixer_fill_identical() argument
121 * an identity matrix */ in gst_audio_channel_mixer_fill_identical()
123 matrix[ci][co] = ci == co ? 1.0 : 0.0; in gst_audio_channel_mixer_fill_identical()
125 matrix[ci][co] = 1.0; in gst_audio_channel_mixer_fill_identical()
138 gst_audio_channel_mixer_fill_compatible (gfloat ** matrix, gint in_channels, in gst_audio_channel_mixer_fill_compatible() argument
196 matrix[pos1_0][pos2_2] = 1.0; in gst_audio_channel_mixer_fill_compatible()
198 matrix[pos1_0][pos2_2] = 0.5; in gst_audio_channel_mixer_fill_compatible()
200 matrix[pos1_0][pos2_2] = 1.0; in gst_audio_channel_mixer_fill_compatible()
204 matrix[pos1_1][pos2_2] = 1.0; in gst_audio_channel_mixer_fill_compatible()
206 matrix[pos1_1][pos2_2] = 0.5; in gst_audio_channel_mixer_fill_compatible()
208 matrix[pos1_1][pos2_2] = 1.0; in gst_audio_channel_mixer_fill_compatible()
212 matrix[pos1_2][pos2_0] = 1.0; in gst_audio_channel_mixer_fill_compatible()
214 matrix[pos1_2][pos2_0] = 0.5; in gst_audio_channel_mixer_fill_compatible()
216 matrix[pos1_2][pos2_0] = 1.0; in gst_audio_channel_mixer_fill_compatible()
220 matrix[pos1_2][pos2_1] = 1.0; in gst_audio_channel_mixer_fill_compatible()
222 matrix[pos1_2][pos2_1] = 0.5; in gst_audio_channel_mixer_fill_compatible()
224 matrix[pos1_2][pos2_1] = 1.0; in gst_audio_channel_mixer_fill_compatible()
302 gst_audio_channel_mixer_fill_one_other (gfloat ** matrix, in gst_audio_channel_mixer_fill_one_other() argument
308 matrix[from_idx[1]][to_idx[1]] = ratio; in gst_audio_channel_mixer_fill_one_other()
313 matrix[from_idx[0]][to_idx[0]] = ratio; in gst_audio_channel_mixer_fill_one_other()
318 matrix[from_idx[2]][to_idx[2]] = ratio; in gst_audio_channel_mixer_fill_one_other()
323 matrix[from_idx[0]][to_idx[1]] = 0.5 * ratio; in gst_audio_channel_mixer_fill_one_other()
325 matrix[from_idx[0]][to_idx[1]] = ratio; in gst_audio_channel_mixer_fill_one_other()
330 matrix[from_idx[2]][to_idx[1]] = 0.5 * ratio; in gst_audio_channel_mixer_fill_one_other()
332 matrix[from_idx[2]][to_idx[1]] = ratio; in gst_audio_channel_mixer_fill_one_other()
337 matrix[from_idx[1]][to_idx[0]] = 0.5 * ratio; in gst_audio_channel_mixer_fill_one_other()
339 matrix[from_idx[1]][to_idx[0]] = ratio; in gst_audio_channel_mixer_fill_one_other()
344 matrix[from_idx[1]][to_idx[2]] = 0.5 * ratio; in gst_audio_channel_mixer_fill_one_other()
346 matrix[from_idx[1]][to_idx[2]] = ratio; in gst_audio_channel_mixer_fill_one_other()
368 gst_audio_channel_mixer_fill_others (gfloat ** matrix, gint in_channels, in gst_audio_channel_mixer_fill_others() argument
394 * which we want to convert are located in our matrix/array. */ in gst_audio_channel_mixer_fill_others()
416 gst_audio_channel_mixer_fill_one_other (matrix, in_f, out_c, in gst_audio_channel_mixer_fill_others()
419 gst_audio_channel_mixer_fill_one_other (matrix, in_s, out_c, in gst_audio_channel_mixer_fill_others()
423 gst_audio_channel_mixer_fill_one_other (matrix, in_r, out_c, in gst_audio_channel_mixer_fill_others()
426 gst_audio_channel_mixer_fill_one_other (matrix, in_c, out_f, in gst_audio_channel_mixer_fill_others()
429 gst_audio_channel_mixer_fill_one_other (matrix, in_c, out_s, in gst_audio_channel_mixer_fill_others()
433 gst_audio_channel_mixer_fill_one_other (matrix, in_c, out_r, in gst_audio_channel_mixer_fill_others()
439 gst_audio_channel_mixer_fill_one_other (matrix, in_c, out_f, in gst_audio_channel_mixer_fill_others()
442 gst_audio_channel_mixer_fill_one_other (matrix, in_s, out_f, in gst_audio_channel_mixer_fill_others()
445 gst_audio_channel_mixer_fill_one_other (matrix, in_c, out_f, in gst_audio_channel_mixer_fill_others()
447 gst_audio_channel_mixer_fill_one_other (matrix, in_s, out_f, in gst_audio_channel_mixer_fill_others()
451 gst_audio_channel_mixer_fill_one_other (matrix, in_r, out_f, in gst_audio_channel_mixer_fill_others()
454 gst_audio_channel_mixer_fill_one_other (matrix, in gst_audio_channel_mixer_fill_others()
457 gst_audio_channel_mixer_fill_one_other (matrix, in_f, out_s, in gst_audio_channel_mixer_fill_others()
460 gst_audio_channel_mixer_fill_one_other (matrix, in_f, out_c, in gst_audio_channel_mixer_fill_others()
462 gst_audio_channel_mixer_fill_one_other (matrix, in_f, out_s, in gst_audio_channel_mixer_fill_others()
466 gst_audio_channel_mixer_fill_one_other (matrix, in_f, out_r, in gst_audio_channel_mixer_fill_others()
472 gst_audio_channel_mixer_fill_one_other (matrix, in_f, out_s, in gst_audio_channel_mixer_fill_others()
475 gst_audio_channel_mixer_fill_one_other (matrix, in_r, out_s, in gst_audio_channel_mixer_fill_others()
478 gst_audio_channel_mixer_fill_one_other (matrix, in_f, out_s, in gst_audio_channel_mixer_fill_others()
480 gst_audio_channel_mixer_fill_one_other (matrix, in_r, out_s, in gst_audio_channel_mixer_fill_others()
484 gst_audio_channel_mixer_fill_one_other (matrix, in_c, out_s, in gst_audio_channel_mixer_fill_others()
487 gst_audio_channel_mixer_fill_one_other (matrix, in_s, out_f, in gst_audio_channel_mixer_fill_others()
490 gst_audio_channel_mixer_fill_one_other (matrix, in_s, out_r, in gst_audio_channel_mixer_fill_others()
493 gst_audio_channel_mixer_fill_one_other (matrix, in_s, out_f, in gst_audio_channel_mixer_fill_others()
495 gst_audio_channel_mixer_fill_one_other (matrix, in_s, out_r, in gst_audio_channel_mixer_fill_others()
499 gst_audio_channel_mixer_fill_one_other (matrix, in_s, out_c, in gst_audio_channel_mixer_fill_others()
505 gst_audio_channel_mixer_fill_one_other (matrix, in_s, out_r, in gst_audio_channel_mixer_fill_others()
508 gst_audio_channel_mixer_fill_one_other (matrix, in_f, out_r, in gst_audio_channel_mixer_fill_others()
512 gst_audio_channel_mixer_fill_one_other (matrix, in_c, out_r, in gst_audio_channel_mixer_fill_others()
515 gst_audio_channel_mixer_fill_one_other (matrix, in_r, out_s, in gst_audio_channel_mixer_fill_others()
518 gst_audio_channel_mixer_fill_one_other (matrix, in_r, out_f, in gst_audio_channel_mixer_fill_others()
522 gst_audio_channel_mixer_fill_one_other (matrix, in_r, out_c, in gst_audio_channel_mixer_fill_others()
529 gst_audio_channel_mixer_fill_one_other (matrix, in_b, out_c, in gst_audio_channel_mixer_fill_others()
533 gst_audio_channel_mixer_fill_one_other (matrix, in_b, out_f, in gst_audio_channel_mixer_fill_others()
537 gst_audio_channel_mixer_fill_one_other (matrix, in_b, out_s, in gst_audio_channel_mixer_fill_others()
541 gst_audio_channel_mixer_fill_one_other (matrix, in_b, out_r, in gst_audio_channel_mixer_fill_others()
546 gst_audio_channel_mixer_fill_one_other (matrix, in_c, out_b, in gst_audio_channel_mixer_fill_others()
550 gst_audio_channel_mixer_fill_one_other (matrix, in_f, out_b, in gst_audio_channel_mixer_fill_others()
554 gst_audio_channel_mixer_fill_one_other (matrix, in_s, out_b, in gst_audio_channel_mixer_fill_others()
558 gst_audio_channel_mixer_fill_one_other (matrix, in_r, out_b, in gst_audio_channel_mixer_fill_others()
569 gst_audio_channel_mixer_fill_normalize (gfloat ** matrix, gint in_channels, in gst_audio_channel_mixer_fill_normalize() argument
579 sum += fabs (matrix[i][j]); in gst_audio_channel_mixer_fill_normalize()
592 matrix[i][j] /= top; in gst_audio_channel_mixer_fill_normalize()
598 gst_audio_channel_mixer_fill_special (gfloat ** matrix, gint in_channels, in gst_audio_channel_mixer_fill_special() argument
611 matrix[0][0] = 0.5; in gst_audio_channel_mixer_fill_special()
612 matrix[1][0] = 0.5; in gst_audio_channel_mixer_fill_special()
620 matrix[0][0] = 1.0; in gst_audio_channel_mixer_fill_special()
621 matrix[0][1] = 1.0; in gst_audio_channel_mixer_fill_special()
631 * Automagically generate conversion matrix.
635 gst_audio_channel_mixer_fill_matrix (gfloat ** matrix, in gst_audio_channel_mixer_fill_matrix() argument
640 if (gst_audio_channel_mixer_fill_special (matrix, in_channels, in_position, in gst_audio_channel_mixer_fill_matrix()
644 gst_audio_channel_mixer_fill_identical (matrix, in_channels, in_position, in gst_audio_channel_mixer_fill_matrix()
648 gst_audio_channel_mixer_fill_compatible (matrix, in_channels, in_position, in gst_audio_channel_mixer_fill_matrix()
650 gst_audio_channel_mixer_fill_others (matrix, in_channels, in_position, in gst_audio_channel_mixer_fill_matrix()
652 gst_audio_channel_mixer_fill_normalize (matrix, in_channels, out_channels); in gst_audio_channel_mixer_fill_matrix()
656 /* only call mix after mix->matrix is fully set up and normalized */
670 tmp = mix->matrix[i][j] * factor; in gst_audio_channel_mixer_setup_matrix_int()
682 gfloat **matrix = g_new0 (gfloat *, in_channels); in gst_audio_channel_mixer_setup_matrix() local
685 matrix[i] = g_new (gfloat, out_channels); in gst_audio_channel_mixer_setup_matrix()
687 matrix[i][j] = 0.; in gst_audio_channel_mixer_setup_matrix()
690 /* setup the matrix' internal values */ in gst_audio_channel_mixer_setup_matrix()
691 gst_audio_channel_mixer_fill_matrix (matrix, flags, in_channels, in_position, in gst_audio_channel_mixer_setup_matrix()
694 return matrix; in gst_audio_channel_mixer_setup_matrix()
750 /* remove factor from int matrix */ \
778 mix->matrix[in][out]; \
814 * @matrix: (transfer full) (nullable): channel conversion matrix, m[@in_channels][@out_channels].
815 * If identity matrix, passthrough applies. If %NULL, a (potentially truncated)
816 * identity matrix is generated.
821 * @matrix is invalid, or @matrix is %NULL and @in_channels != @out_channels.
829 gint in_channels, gint out_channels, gfloat ** matrix) in gst_audio_channel_mixer_new_with_matrix() argument
844 if (!matrix) { in gst_audio_channel_mixer_new_with_matrix()
845 /* Generate (potentially truncated) identity matrix */ in gst_audio_channel_mixer_new_with_matrix()
848 mix->matrix = g_new0 (gfloat *, in_channels); in gst_audio_channel_mixer_new_with_matrix()
851 mix->matrix[i] = g_new (gfloat, out_channels); in gst_audio_channel_mixer_new_with_matrix()
853 mix->matrix[i][j] = i == j ? 1.0 : 0.0; in gst_audio_channel_mixer_new_with_matrix()
857 mix->matrix = matrix; in gst_audio_channel_mixer_new_with_matrix()
868 s = g_string_new ("Matrix for"); in gst_audio_channel_mixer_new_with_matrix()
879 g_string_append_printf (s, " %f", mix->matrix[i][j]); in gst_audio_channel_mixer_new_with_matrix()
993 gfloat **matrix; in gst_audio_channel_mixer_new() local
1002 matrix = in gst_audio_channel_mixer_new()
1006 out_channels, matrix); in gst_audio_channel_mixer_new()
1016 * this is determined by comparing the contents of the matrix
1041 if ((i == j && mix->matrix[i][j] != 1.0f) || in gst_audio_channel_mixer_is_passthrough()
1042 (i != j && mix->matrix[i][j] != 0.0f)) { in gst_audio_channel_mixer_is_passthrough()
1073 g_return_if_fail (mix->matrix != NULL); in gst_audio_channel_mixer_samples()