@@ -105,6 +105,7 @@ static struct ast_codec g723 = {
105
105
.minimum_bytes = 20 ,
106
106
.samples_count = g723_samples ,
107
107
.get_length = g723_length ,
108
+ .quality = 20 ,
108
109
};
109
110
110
111
static int codec2_samples (struct ast_frame * frame )
@@ -175,6 +176,7 @@ static struct ast_codec ulaw = {
175
176
.samples_count = ulaw_samples ,
176
177
.get_length = ulaw_length ,
177
178
.smooth = 1 ,
179
+ .quality = 100 , /* We are the gold standard. */
178
180
};
179
181
180
182
static struct ast_codec alaw = {
@@ -189,6 +191,7 @@ static struct ast_codec alaw = {
189
191
.samples_count = ulaw_samples ,
190
192
.get_length = ulaw_length ,
191
193
.smooth = 1 ,
194
+ .quality = 100 , /* Just as good as ulaw */
192
195
};
193
196
194
197
static int gsm_samples (struct ast_frame * frame )
@@ -213,6 +216,7 @@ static struct ast_codec gsm = {
213
216
.samples_count = gsm_samples ,
214
217
.get_length = gsm_length ,
215
218
.smooth = 1 ,
219
+ .quality = 60 ,
216
220
};
217
221
218
222
static int g726_samples (struct ast_frame * frame )
@@ -237,6 +241,7 @@ static struct ast_codec g726rfc3551 = {
237
241
.samples_count = g726_samples ,
238
242
.get_length = g726_length ,
239
243
.smooth = 1 ,
244
+ .quality = 85 ,
240
245
};
241
246
242
247
static struct ast_codec g726aal2 = {
@@ -251,6 +256,7 @@ static struct ast_codec g726aal2 = {
251
256
.samples_count = g726_samples ,
252
257
.get_length = g726_length ,
253
258
.smooth = 1 ,
259
+ .quality = 85 ,
254
260
};
255
261
256
262
static struct ast_codec adpcm = {
@@ -265,6 +271,7 @@ static struct ast_codec adpcm = {
265
271
.samples_count = g726_samples ,
266
272
.get_length = g726_length ,
267
273
.smooth = 1 ,
274
+ .quality = 80 ,
268
275
};
269
276
270
277
static int slin_samples (struct ast_frame * frame )
@@ -290,6 +297,7 @@ static struct ast_codec slin8 = {
290
297
.get_length = slin_length ,
291
298
.smooth = 1 ,
292
299
.smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
300
+ .quality = 115 , /* Better than ulaw */
293
301
};
294
302
295
303
static struct ast_codec slin12 = {
@@ -305,6 +313,7 @@ static struct ast_codec slin12 = {
305
313
.get_length = slin_length ,
306
314
.smooth = 1 ,
307
315
.smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
316
+ .quality = 116 ,
308
317
};
309
318
310
319
static struct ast_codec slin16 = {
@@ -320,6 +329,7 @@ static struct ast_codec slin16 = {
320
329
.get_length = slin_length ,
321
330
.smooth = 1 ,
322
331
.smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
332
+ .quality = 117 ,
323
333
};
324
334
325
335
static struct ast_codec slin24 = {
@@ -335,6 +345,7 @@ static struct ast_codec slin24 = {
335
345
.get_length = slin_length ,
336
346
.smooth = 1 ,
337
347
.smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
348
+ .quality = 118 ,
338
349
};
339
350
340
351
static struct ast_codec slin32 = {
@@ -350,6 +361,7 @@ static struct ast_codec slin32 = {
350
361
.get_length = slin_length ,
351
362
.smooth = 1 ,
352
363
.smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
364
+ .quality = 119 ,
353
365
};
354
366
355
367
static struct ast_codec slin44 = {
@@ -365,6 +377,7 @@ static struct ast_codec slin44 = {
365
377
.get_length = slin_length ,
366
378
.smooth = 1 ,
367
379
.smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
380
+ .quality = 120 ,
368
381
};
369
382
370
383
static struct ast_codec slin48 = {
@@ -380,6 +393,7 @@ static struct ast_codec slin48 = {
380
393
.get_length = slin_length ,
381
394
.smooth = 1 ,
382
395
.smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
396
+ .quality = 121 ,
383
397
};
384
398
385
399
static struct ast_codec slin96 = {
@@ -395,6 +409,7 @@ static struct ast_codec slin96 = {
395
409
.get_length = slin_length ,
396
410
.smooth = 1 ,
397
411
.smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
412
+ .quality = 122 ,
398
413
};
399
414
400
415
static struct ast_codec slin192 = {
@@ -410,6 +425,7 @@ static struct ast_codec slin192 = {
410
425
.get_length = slin_length ,
411
426
.smooth = 1 ,
412
427
.smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED ,
428
+ .quality = 123 ,
413
429
};
414
430
415
431
static int lpc10_samples (struct ast_frame * frame )
@@ -433,6 +449,7 @@ static struct ast_codec lpc10 = {
433
449
.minimum_bytes = 7 ,
434
450
.samples_count = lpc10_samples ,
435
451
.smooth = 1 ,
452
+ .quality = 25 ,
436
453
};
437
454
438
455
static int g729_samples (struct ast_frame * frame )
@@ -458,6 +475,7 @@ static struct ast_codec g729a = {
458
475
.get_length = g729_length ,
459
476
.smooth = 1 ,
460
477
.smoother_flags = AST_SMOOTHER_FLAG_G729 ,
478
+ .quality = 20 ,
461
479
};
462
480
463
481
static unsigned char get_n_bits_at (unsigned char * data , int n , int bit )
@@ -584,6 +602,7 @@ static struct ast_codec speex8 = {
584
602
.default_ms = 20 ,
585
603
.minimum_bytes = 10 ,
586
604
.samples_count = speex8_samples ,
605
+ .quality = 40 ,
587
606
};
588
607
589
608
static int speex16_samples (struct ast_frame * frame )
@@ -601,6 +620,7 @@ static struct ast_codec speex16 = {
601
620
.default_ms = 20 ,
602
621
.minimum_bytes = 10 ,
603
622
.samples_count = speex16_samples ,
623
+ .quality = 40 ,
604
624
};
605
625
606
626
static int speex32_samples (struct ast_frame * frame )
@@ -618,6 +638,7 @@ static struct ast_codec speex32 = {
618
638
.default_ms = 20 ,
619
639
.minimum_bytes = 10 ,
620
640
.samples_count = speex32_samples ,
641
+ .quality = 40 ,
621
642
};
622
643
623
644
static int ilbc_samples (struct ast_frame * frame )
@@ -641,6 +662,7 @@ static struct ast_codec ilbc = {
641
662
.minimum_bytes = 38 ,
642
663
.samples_count = ilbc_samples ,
643
664
.smooth = 0 ,
665
+ .quality = 45 ,
644
666
};
645
667
646
668
static struct ast_codec g722 = {
@@ -655,6 +677,7 @@ static struct ast_codec g722 = {
655
677
.samples_count = g726_samples ,
656
678
.get_length = g726_length ,
657
679
.smooth = 1 ,
680
+ .quality = 110 , /* In theory, better than ulaw */
658
681
};
659
682
660
683
static int siren7_samples (struct ast_frame * frame )
@@ -678,6 +701,7 @@ static struct ast_codec siren7 = {
678
701
.minimum_bytes = 80 ,
679
702
.samples_count = siren7_samples ,
680
703
.get_length = siren7_length ,
704
+ .quality = 85 ,
681
705
};
682
706
683
707
static int siren14_samples (struct ast_frame * frame )
@@ -701,6 +725,7 @@ static struct ast_codec siren14 = {
701
725
.minimum_bytes = 120 ,
702
726
.samples_count = siren14_samples ,
703
727
.get_length = siren14_length ,
728
+ .quality = 90 ,
704
729
};
705
730
706
731
static int g719_samples (struct ast_frame * frame )
@@ -724,6 +749,7 @@ static struct ast_codec g719 = {
724
749
.minimum_bytes = 160 ,
725
750
.samples_count = g719_samples ,
726
751
.get_length = g719_length ,
752
+ .quality = 95 ,
727
753
};
728
754
729
755
static int opus_samples (struct ast_frame * frame )
@@ -751,6 +777,7 @@ static struct ast_codec opus = {
751
777
.default_ms = 20 ,
752
778
.samples_count = opus_samples ,
753
779
.minimum_bytes = 10 ,
780
+ .quality = 50 ,
754
781
};
755
782
756
783
static struct ast_codec jpeg = {
@@ -859,7 +886,7 @@ static struct ast_codec silk8 = {
859
886
.maximum_ms = 100 ,
860
887
.default_ms = 20 ,
861
888
.minimum_bytes = 160 ,
862
- .samples_count = silk_samples
889
+ .samples_count = silk_samples ,
863
890
};
864
891
865
892
static struct ast_codec silk12 = {
0 commit comments