Originally committed as revision 14832 to svn://svn.ffmpeg.org/ffmpeg/trunk
| ... | ... |
@@ -39,7 +39,8 @@ static const SampleFmtInfo sample_fmt_info[SAMPLE_FMT_NB] = {
|
| 39 | 39 |
[SAMPLE_FMT_S16] = { .name = "s16", .bits = 16 },
|
| 40 | 40 |
[SAMPLE_FMT_S24] = { .name = "s24", .bits = 24 },
|
| 41 | 41 |
[SAMPLE_FMT_S32] = { .name = "s32", .bits = 32 },
|
| 42 |
- [SAMPLE_FMT_FLT] = { .name = "flt", .bits = 32 }
|
|
| 42 |
+ [SAMPLE_FMT_FLT] = { .name = "flt", .bits = 32 },
|
|
| 43 |
+ [SAMPLE_FMT_DBL] = { .name = "dbl", .bits = 64 },
|
|
| 43 | 44 |
}; |
| 44 | 45 |
|
| 45 | 46 |
const char *avcodec_get_sample_fmt_name(int sample_fmt) |
| ... | ... |
@@ -127,18 +128,27 @@ if(ctx->fmt_pair == ofmt + SAMPLE_FMT_NB*ifmt){\
|
| 127 | 127 |
else CONV(SAMPLE_FMT_S16, int16_t, SAMPLE_FMT_U8 , (*(uint8_t*)pi - 0x80)<<8) |
| 128 | 128 |
else CONV(SAMPLE_FMT_S32, int32_t, SAMPLE_FMT_U8 , (*(uint8_t*)pi - 0x80)<<24) |
| 129 | 129 |
else CONV(SAMPLE_FMT_FLT, float , SAMPLE_FMT_U8 , (*(uint8_t*)pi - 0x80)*(1.0 / (1<<7))) |
| 130 |
+ else CONV(SAMPLE_FMT_DBL, double , SAMPLE_FMT_U8 , (*(uint8_t*)pi - 0x80)*(1.0 / (1<<7))) |
|
| 130 | 131 |
else CONV(SAMPLE_FMT_U8 , uint8_t, SAMPLE_FMT_S16, (*(int16_t*)pi>>8) + 0x80) |
| 131 | 132 |
else CONV(SAMPLE_FMT_S16, int16_t, SAMPLE_FMT_S16, *(int16_t*)pi) |
| 132 | 133 |
else CONV(SAMPLE_FMT_S32, int32_t, SAMPLE_FMT_S16, *(int16_t*)pi<<16) |
| 133 | 134 |
else CONV(SAMPLE_FMT_FLT, float , SAMPLE_FMT_S16, *(int16_t*)pi*(1.0 / (1<<15))) |
| 135 |
+ else CONV(SAMPLE_FMT_DBL, double , SAMPLE_FMT_S16, *(int16_t*)pi*(1.0 / (1<<15))) |
|
| 134 | 136 |
else CONV(SAMPLE_FMT_U8 , uint8_t, SAMPLE_FMT_S32, (*(int32_t*)pi>>24) + 0x80) |
| 135 | 137 |
else CONV(SAMPLE_FMT_S16, int16_t, SAMPLE_FMT_S32, *(int32_t*)pi>>16) |
| 136 | 138 |
else CONV(SAMPLE_FMT_S32, int32_t, SAMPLE_FMT_S32, *(int32_t*)pi) |
| 137 | 139 |
else CONV(SAMPLE_FMT_FLT, float , SAMPLE_FMT_S32, *(int32_t*)pi*(1.0 / (1<<31))) |
| 140 |
+ else CONV(SAMPLE_FMT_DBL, double , SAMPLE_FMT_S32, *(int32_t*)pi*(1.0 / (1<<31))) |
|
| 138 | 141 |
else CONV(SAMPLE_FMT_U8 , uint8_t, SAMPLE_FMT_FLT, lrintf(*(float*)pi * (1<<7)) + 0x80) |
| 139 | 142 |
else CONV(SAMPLE_FMT_S16, int16_t, SAMPLE_FMT_FLT, lrintf(*(float*)pi * (1<<15))) |
| 140 | 143 |
else CONV(SAMPLE_FMT_S32, int32_t, SAMPLE_FMT_FLT, lrintf(*(float*)pi * (1<<31))) |
| 141 | 144 |
else CONV(SAMPLE_FMT_FLT, float , SAMPLE_FMT_FLT, *(float*)pi) |
| 145 |
+ else CONV(SAMPLE_FMT_DBL, double , SAMPLE_FMT_FLT, *(float*)pi) |
|
| 146 |
+ else CONV(SAMPLE_FMT_U8 , uint8_t, SAMPLE_FMT_DBL, lrint(*(double*)pi * (1<<7)) + 0x80) |
|
| 147 |
+ else CONV(SAMPLE_FMT_S16, int16_t, SAMPLE_FMT_DBL, lrint(*(double*)pi * (1<<15))) |
|
| 148 |
+ else CONV(SAMPLE_FMT_S32, int32_t, SAMPLE_FMT_DBL, lrint(*(double*)pi * (1<<31))) |
|
| 149 |
+ else CONV(SAMPLE_FMT_FLT, float , SAMPLE_FMT_DBL, *(double*)pi) |
|
| 150 |
+ else CONV(SAMPLE_FMT_DBL, double , SAMPLE_FMT_DBL, *(double*)pi) |
|
| 142 | 151 |
else return -1; |
| 143 | 152 |
} |
| 144 | 153 |
return 0; |
| ... | ... |
@@ -30,7 +30,7 @@ |
| 30 | 30 |
#include "libavutil/avutil.h" |
| 31 | 31 |
|
| 32 | 32 |
#define LIBAVCODEC_VERSION_MAJOR 51 |
| 33 |
-#define LIBAVCODEC_VERSION_MINOR 64 |
|
| 33 |
+#define LIBAVCODEC_VERSION_MINOR 65 |
|
| 34 | 34 |
#define LIBAVCODEC_VERSION_MICRO 0 |
| 35 | 35 |
|
| 36 | 36 |
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |
| ... | ... |
@@ -348,6 +348,7 @@ enum SampleFormat {
|
| 348 | 348 |
SAMPLE_FMT_S24, ///< signed 24 bits @deprecated Deprecated in favor of SAMPLE_FMT_S32 |
| 349 | 349 |
SAMPLE_FMT_S32, ///< signed 32 bits |
| 350 | 350 |
SAMPLE_FMT_FLT, ///< float |
| 351 |
+ SAMPLE_FMT_DBL, ///< double |
|
| 351 | 352 |
SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if dynamically linking to libavcodec |
| 352 | 353 |
}; |
| 353 | 354 |
|