@@ -105,6 +105,7 @@ static struct ast_codec g723 = {
105105 .minimum_bytes = 20 ,
106106 .samples_count = g723_samples ,
107107 .get_length = g723_length ,
108+ .quality = 20 ,
108109};
109110
110111static int codec2_samples (struct ast_frame * frame )
@@ -175,6 +176,7 @@ static struct ast_codec ulaw = {
175176 .samples_count = ulaw_samples ,
176177 .get_length = ulaw_length ,
177178 .smooth = 1 ,
179+ .quality = 100 , /* We are the gold standard. */
178180};
179181
180182static struct ast_codec alaw = {
@@ -189,6 +191,7 @@ static struct ast_codec alaw = {
189191 .samples_count = ulaw_samples ,
190192 .get_length = ulaw_length ,
191193 .smooth = 1 ,
194+ .quality = 100 , /* Just as good as ulaw */
192195};
193196
194197static int gsm_samples (struct ast_frame * frame )
@@ -213,6 +216,7 @@ static struct ast_codec gsm = {
213216 .samples_count = gsm_samples ,
214217 .get_length = gsm_length ,
215218 .smooth = 1 ,
219+ .quality = 60 ,
216220};
217221
218222static int g726_samples (struct ast_frame * frame )
@@ -237,6 +241,7 @@ static struct ast_codec g726rfc3551 = {
237241 .samples_count = g726_samples ,
238242 .get_length = g726_length ,
239243 .smooth = 1 ,
244+ .quality = 85 ,
240245};
241246
242247static struct ast_codec g726aal2 = {
@@ -251,6 +256,7 @@ static struct ast_codec g726aal2 = {
251256 .samples_count = g726_samples ,
252257 .get_length = g726_length ,
253258 .smooth = 1 ,
259+ .quality = 85 ,
254260};
255261
256262static struct ast_codec adpcm = {
@@ -265,6 +271,7 @@ static struct ast_codec adpcm = {
265271 .samples_count = g726_samples ,
266272 .get_length = g726_length ,
267273 .smooth = 1 ,
274+ .quality = 80 ,
268275};
269276
270277static int slin_samples (struct ast_frame * frame )
@@ -290,6 +297,7 @@ static struct ast_codec slin8 = {
290297 .get_length = slin_length ,
291298 .smooth = 1 ,
292299 .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
300+ .quality = 115 , /* Better than ulaw */
293301};
294302
295303static struct ast_codec slin12 = {
@@ -305,6 +313,7 @@ static struct ast_codec slin12 = {
305313 .get_length = slin_length ,
306314 .smooth = 1 ,
307315 .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
316+ .quality = 116 ,
308317};
309318
310319static struct ast_codec slin16 = {
@@ -320,6 +329,7 @@ static struct ast_codec slin16 = {
320329 .get_length = slin_length ,
321330 .smooth = 1 ,
322331 .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
332+ .quality = 117 ,
323333};
324334
325335static struct ast_codec slin24 = {
@@ -335,6 +345,7 @@ static struct ast_codec slin24 = {
335345 .get_length = slin_length ,
336346 .smooth = 1 ,
337347 .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
348+ .quality = 118 ,
338349};
339350
340351static struct ast_codec slin32 = {
@@ -350,6 +361,7 @@ static struct ast_codec slin32 = {
350361 .get_length = slin_length ,
351362 .smooth = 1 ,
352363 .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
364+ .quality = 119 ,
353365};
354366
355367static struct ast_codec slin44 = {
@@ -365,6 +377,7 @@ static struct ast_codec slin44 = {
365377 .get_length = slin_length ,
366378 .smooth = 1 ,
367379 .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
380+ .quality = 120 ,
368381};
369382
370383static struct ast_codec slin48 = {
@@ -380,6 +393,7 @@ static struct ast_codec slin48 = {
380393 .get_length = slin_length ,
381394 .smooth = 1 ,
382395 .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
396+ .quality = 121 ,
383397};
384398
385399static struct ast_codec slin96 = {
@@ -395,6 +409,7 @@ static struct ast_codec slin96 = {
395409 .get_length = slin_length ,
396410 .smooth = 1 ,
397411 .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
412+ .quality = 122 ,
398413};
399414
400415static struct ast_codec slin192 = {
@@ -410,6 +425,7 @@ static struct ast_codec slin192 = {
410425 .get_length = slin_length ,
411426 .smooth = 1 ,
412427 .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
428+ .quality = 123 ,
413429};
414430
415431static int lpc10_samples (struct ast_frame * frame )
@@ -433,6 +449,7 @@ static struct ast_codec lpc10 = {
433449 .minimum_bytes = 7 ,
434450 .samples_count = lpc10_samples ,
435451 .smooth = 1 ,
452+ .quality = 25 ,
436453};
437454
438455static int g729_samples (struct ast_frame * frame )
@@ -458,6 +475,7 @@ static struct ast_codec g729a = {
458475 .get_length = g729_length ,
459476 .smooth = 1 ,
460477 .smoother_flags = AST_SMOOTHER_FLAG_G729 ,
478+ .quality = 20 ,
461479};
462480
463481static unsigned char get_n_bits_at (unsigned char * data , int n , int bit )
@@ -584,6 +602,7 @@ static struct ast_codec speex8 = {
584602 .default_ms = 20 ,
585603 .minimum_bytes = 10 ,
586604 .samples_count = speex8_samples ,
605+ .quality = 40 ,
587606};
588607
589608static int speex16_samples (struct ast_frame * frame )
@@ -601,6 +620,7 @@ static struct ast_codec speex16 = {
601620 .default_ms = 20 ,
602621 .minimum_bytes = 10 ,
603622 .samples_count = speex16_samples ,
623+ .quality = 40 ,
604624};
605625
606626static int speex32_samples (struct ast_frame * frame )
@@ -618,6 +638,7 @@ static struct ast_codec speex32 = {
618638 .default_ms = 20 ,
619639 .minimum_bytes = 10 ,
620640 .samples_count = speex32_samples ,
641+ .quality = 40 ,
621642};
622643
623644static int ilbc_samples (struct ast_frame * frame )
@@ -641,6 +662,7 @@ static struct ast_codec ilbc = {
641662 .minimum_bytes = 38 ,
642663 .samples_count = ilbc_samples ,
643664 .smooth = 0 ,
665+ .quality = 45 ,
644666};
645667
646668static struct ast_codec g722 = {
@@ -655,6 +677,7 @@ static struct ast_codec g722 = {
655677 .samples_count = g726_samples ,
656678 .get_length = g726_length ,
657679 .smooth = 1 ,
680+ .quality = 110 , /* In theory, better than ulaw */
658681};
659682
660683static int siren7_samples (struct ast_frame * frame )
@@ -678,6 +701,7 @@ static struct ast_codec siren7 = {
678701 .minimum_bytes = 80 ,
679702 .samples_count = siren7_samples ,
680703 .get_length = siren7_length ,
704+ .quality = 85 ,
681705};
682706
683707static int siren14_samples (struct ast_frame * frame )
@@ -701,6 +725,7 @@ static struct ast_codec siren14 = {
701725 .minimum_bytes = 120 ,
702726 .samples_count = siren14_samples ,
703727 .get_length = siren14_length ,
728+ .quality = 90 ,
704729};
705730
706731static int g719_samples (struct ast_frame * frame )
@@ -724,6 +749,7 @@ static struct ast_codec g719 = {
724749 .minimum_bytes = 160 ,
725750 .samples_count = g719_samples ,
726751 .get_length = g719_length ,
752+ .quality = 95 ,
727753};
728754
729755static int opus_samples (struct ast_frame * frame )
@@ -751,6 +777,7 @@ static struct ast_codec opus = {
751777 .default_ms = 20 ,
752778 .samples_count = opus_samples ,
753779 .minimum_bytes = 10 ,
780+ .quality = 50 ,
754781};
755782
756783static struct ast_codec jpeg = {
@@ -859,7 +886,7 @@ static struct ast_codec silk8 = {
859886 .maximum_ms = 100 ,
860887 .default_ms = 20 ,
861888 .minimum_bytes = 160 ,
862- .samples_count = silk_samples
889+ .samples_count = silk_samples ,
863890};
864891
865892static struct ast_codec silk12 = {
0 commit comments