History

lswr/rematrix: Support s32p.

Fixes ticket #6785.

Carl Eugen Hoyos committed 9 years ago

Commit ff994c21 parent 7a02b362 files · +15 −6Browse files

Showing the changes to libswresample (2 of 2 files). Show all

Unified · Split

2 files
  1. libswresample/rematrix.c +14 −5
  2. libswresample/version.h +1 −1
libswresample/rematrix.c+14−5
@@ -445,14 +445,23 @@ av_cold int swri_rematrix_init(SwrContext *s){ · 444 unmodified lines
445 s->mix_2_1_f = (mix_2_1_func_type*)sum2_double;445 s->mix_2_1_f = (mix_2_1_func_type*)sum2_double;
446 s->mix_any_f = (mix_any_func_type*)get_mix_any_func_double(s);446 s->mix_any_f = (mix_any_func_type*)get_mix_any_func_double(s);
447 }else if(s->midbuf.fmt == AV_SAMPLE_FMT_S32P){447 }else if(s->midbuf.fmt == AV_SAMPLE_FMT_S32P){
448 // Only for dithering currently
449// s->native_matrix = av_calloc(nb_in * nb_out, sizeof(double));
450 s->native_one = av_mallocz(sizeof(int));448 s->native_one = av_mallocz(sizeof(int));
451 if (!s->native_one)449 if (!s->native_one)
452 return AVERROR(ENOMEM);450 return AVERROR(ENOMEM);
453// for (i = 0; i < nb_out; i++)451 s->native_matrix = av_calloc(nb_in * nb_out, sizeof(int));
454// for (j = 0; j < nb_in; j++)452 if (!s->native_matrix) {
455// ((double*)s->native_matrix)[i * nb_in + j] = s->matrix[i][j];453 av_freep(&s->native_one);
454 return AVERROR(ENOMEM);
455 }
456 for (i = 0; i < nb_out; i++) {
457 double rem = 0;
458
459 for (j = 0; j < nb_in; j++) {
460 double target = s->matrix[i][j] * 32768 + rem;
461 ((int*)s->native_matrix)[i * nb_in + j] = lrintf(target);
462 rem += target - ((int*)s->native_matrix)[i * nb_in + j];
463 }
464 }
456 *((int*)s->native_one) = 32768;465 *((int*)s->native_one) = 32768;
457 s->mix_1_1_f = (mix_1_1_func_type*)copy_s32;466 s->mix_1_1_f = (mix_1_1_func_type*)copy_s32;
458 s->mix_2_1_f = (mix_2_1_func_type*)sum2_s32;467 s->mix_2_1_f = (mix_2_1_func_type*)sum2_s32;
libswresample/version.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
30 30
31#define LIBSWRESAMPLE_VERSION_MAJOR 331#define LIBSWRESAMPLE_VERSION_MAJOR 3
32#define LIBSWRESAMPLE_VERSION_MINOR 032#define LIBSWRESAMPLE_VERSION_MINOR 0
33#define LIBSWRESAMPLE_VERSION_MICRO 10033#define LIBSWRESAMPLE_VERSION_MICRO 101
34 34
35#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \35#define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
36 LIBSWRESAMPLE_VERSION_MINOR, \36 LIBSWRESAMPLE_VERSION_MINOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t