1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

vmdaudio: output 8-bit audio as AV_SAMPLE_FMT_U8.

There is no need to expand to 16-bits. Just use memcpy() to copy the raw data.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit 1108f8998c)
This commit is contained in:
Justin Ruggles 2011-02-23 13:11:13 -05:00 committed by Michael Niedermayer
parent f3618b014b
commit 1e898e7d35
2 changed files with 193 additions and 194 deletions

View File

@ -445,7 +445,10 @@ static av_cold int vmdaudio_decode_init(AVCodecContext *avctx)
VmdAudioContext *s = avctx->priv_data;
s->avctx = avctx;
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
if (avctx->bits_per_coded_sample == 16)
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
else
avctx->sample_fmt = AV_SAMPLE_FMT_U8;
s->out_bps = av_get_bits_per_sample_fmt(avctx->sample_fmt) >> 3;
av_log(avctx, AV_LOG_DEBUG, "%d channels, %d bits/sample, "
@ -477,21 +480,17 @@ static void vmdaudio_decode_audio(VmdAudioContext *s, unsigned char *data,
static int vmdaudio_loadsound(VmdAudioContext *s, unsigned char *data,
const uint8_t *buf, int silent_chunks, int data_size)
{
int i;
int silent_size = s->avctx->block_align * silent_chunks * s->out_bps;
if (silent_chunks) {
memset(data, 0, silent_size);
memset(data, s->out_bps == 2 ? 0x00 : 0x80, silent_size);
data += silent_size;
}
if (s->avctx->bits_per_coded_sample == 16)
vmdaudio_decode_audio(s, data, buf, data_size, s->avctx->channels == 2);
else {
/* copy the data but convert it to signed */
for (i = 0; i < data_size; i++){
*data++ = buf[i] + 0x80;
*data++ = buf[i] + 0x80;
}
/* just copy the data */
memcpy(data, buf, data_size);
}
return silent_size + data_size * s->out_bps;

View File

@ -1,5 +1,5 @@
0, 0, 230400, 0x0224ab01
1, 0, 123480, 0xc1059826
1, 0, 123480, 0x3a794c13
0, 9000, 230400, 0x449e4d81
0, 18000, 230400, 0x3e15e07a
0, 27000, 230400, 0xdabe4172
@ -27,280 +27,280 @@
0, 225000, 230400, 0x76aebdae
0, 234000, 230400, 0x81357545
0, 243000, 230400, 0x38baeebd
1, 252000, 4410, 0x261a09c0
1, 252000, 4410, 0x109d04e0
0, 252000, 230400, 0x1c5c44d4
1, 261000, 4410, 0x68e9489e
1, 261000, 4410, 0x224d244f
0, 261000, 230400, 0x60e189cc
1, 270000, 4410, 0xb830827a
1, 270000, 4410, 0xbb72413d
0, 270000, 230400, 0xb1f4381c
1, 279000, 4410, 0xb053b70c
1, 279000, 4410, 0xaa5f5b86
0, 279000, 230400, 0xb5048fed
1, 288000, 4410, 0xd8845d5d
1, 288000, 4410, 0x94e7aea7
0, 288000, 230400, 0xc947c30e
1, 297000, 4410, 0xd741f940
1, 297000, 4410, 0xad497ca0
0, 297000, 230400, 0xe8e31c07
1, 306000, 4410, 0x4860193c
1, 306000, 4410, 0x1de10c9e
0, 306000, 230400, 0x6d49dd02
1, 315000, 4410, 0x2e70df5f
1, 315000, 4410, 0x9f55efa8
0, 315000, 230400, 0x293e15d3
1, 324000, 4410, 0x4b3e0e54
1, 324000, 4410, 0x220a072a
0, 324000, 230400, 0x354d792e
1, 333000, 4410, 0x4afbf661
1, 333000, 4410, 0xa7dafb29
0, 333000, 230400, 0x35468780
1, 342000, 4410, 0x485c3903
1, 342000, 4410, 0xd5e29c7a
0, 342000, 230400, 0x365d3991
1, 351000, 4410, 0xc0a1a00c
1, 351000, 4410, 0xb8465006
0, 351000, 230400, 0xc9debef2
1, 360000, 4410, 0x0ce2d38e
1, 360000, 4410, 0x518669c7
0, 360000, 230400, 0x4c4634c2
1, 369000, 4410, 0x5b52dfa3
1, 369000, 4410, 0xb5b5efca
0, 369000, 230400, 0x347c2dca
1, 378000, 4410, 0x0d6c02ba
1, 378000, 4410, 0x8600015d
0, 378000, 230400, 0x1efa0aaa
1, 387000, 4410, 0x55f31fe1
1, 387000, 4410, 0xe2f68fe9
0, 387000, 230400, 0xa79a0b5a
1, 396000, 4410, 0x7350b1b2
1, 396000, 4410, 0x8d3458d9
0, 396000, 230400, 0xfdb2dcdb
1, 405000, 4410, 0x2b918eea
1, 405000, 4410, 0xf1ff4775
0, 405000, 230400, 0x42dbea33
1, 414000, 4410, 0x6df6cf92
1, 414000, 4410, 0x830f67c9
0, 414000, 230400, 0x2a207e43
1, 423000, 4410, 0x2ddd1782
1, 423000, 4410, 0x110e0bc1
0, 423000, 230400, 0x86573783
1, 432000, 4410, 0x12265e8e
1, 432000, 4410, 0x71682f47
0, 432000, 230400, 0xc3968473
1, 441000, 4410, 0x00c62139
1, 441000, 4410, 0x38119095
0, 441000, 230400, 0x8f62a7b4
1, 450000, 4410, 0xf2579b6c
1, 450000, 4410, 0xd2494db6
0, 450000, 230400, 0x5a2e3073
1, 459000, 4410, 0x3bc24a12
1, 459000, 4410, 0x8b552509
0, 459000, 230400, 0xd24f5e2c
1, 468000, 4410, 0x0ce25212
1, 468000, 4410, 0x71e52909
0, 468000, 230400, 0x1df3c67d
1, 477000, 4410, 0xad70de9a
1, 477000, 4410, 0x9f0a6f4d
0, 477000, 230400, 0xe4fd884d
1, 486000, 4410, 0x232705e4
1, 486000, 4410, 0x901302f2
0, 486000, 230400, 0x9a228555
1, 495000, 4410, 0x5ceba444
1, 495000, 4410, 0x855d5222
0, 495000, 230400, 0x9eba8ed5
1, 504000, 4410, 0x17a3660b
1, 504000, 4410, 0x324bb2fe
0, 504000, 230400, 0x3d808a3d
1, 513000, 4410, 0x291bb07e
1, 513000, 4410, 0xe85f583f
0, 513000, 230400, 0xf57e866d
1, 522000, 4410, 0xc13ccf88
1, 522000, 4410, 0x2cbc67c4
0, 522000, 230400, 0x85f594f5
1, 531000, 4410, 0xfb0cd542
1, 531000, 4410, 0xc82e6aa1
0, 531000, 230400, 0xb09f99dd
1, 540000, 4410, 0xb6438478
1, 540000, 4410, 0xb9fc423c
0, 540000, 230400, 0x2b368475
1, 549000, 4410, 0x263e9df2
1, 549000, 4410, 0x6b9b4ef9
0, 549000, 230400, 0xa2417afd
1, 558000, 4410, 0x81621e20
1, 558000, 4410, 0x39290f10
0, 558000, 230400, 0x590b709d
1, 567000, 4410, 0xe9a51d77
1, 567000, 4410, 0xad718eb4
0, 567000, 230400, 0x5d617705
1, 576000, 4410, 0x69a3c758
1, 576000, 4410, 0x82f463ac
0, 576000, 230400, 0xabf981ad
1, 585000, 4410, 0x725af958
1, 585000, 4410, 0xfac87cac
0, 585000, 230400, 0x5a8590cd
1, 594000, 4410, 0x09db995d
1, 594000, 4410, 0x9e8bcca7
0, 594000, 230400, 0x1bff853d
1, 603000, 4410, 0x42963941
1, 603000, 4410, 0x52f79c99
0, 603000, 230400, 0x71d08055
1, 612000, 4410, 0x33a29bc4
1, 612000, 4410, 0xf2d14de2
0, 612000, 230400, 0x2ebd817d
1, 621000, 4410, 0x02ee2bd1
1, 621000, 4410, 0x367f95e1
0, 621000, 230400, 0x6e838255
1, 630000, 4410, 0xda968535
1, 630000, 4410, 0x8bfac293
0, 630000, 230400, 0x043984cd
1, 639000, 4410, 0x5414a080
1, 639000, 4410, 0x01ea5040
0, 639000, 230400, 0x7ff18495
1, 648000, 4410, 0x021ac433
1, 648000, 4410, 0x8ff5e212
0, 648000, 230400, 0xa43b8385
1, 657000, 4410, 0x50195048
1, 657000, 4410, 0x93f32824
0, 657000, 230400, 0x72b5825d
1, 666000, 4410, 0xc40921c7
1, 666000, 4410, 0x998f90dc
0, 666000, 230400, 0x3a178085
1, 675000, 4410, 0xdbb622e0
1, 675000, 4410, 0x65231170
0, 675000, 230400, 0x67748245
1, 684000, 4410, 0xc8d07342
1, 684000, 4410, 0xc79039a1
0, 684000, 230400, 0xeddf81d5
1, 693000, 4410, 0x6ed9b17a
1, 693000, 4410, 0x0b0e58bd
0, 693000, 230400, 0x8b088665
1, 702000, 4410, 0x39ac6a03
1, 702000, 4410, 0xc24ab4fa
0, 702000, 230400, 0x6c408e15
1, 711000, 4410, 0x119ed51c
1, 711000, 4410, 0xd3796a8e
0, 711000, 230400, 0x81f196dd
1, 720000, 4410, 0xc9a20539
1, 720000, 4410, 0xa37f8295
0, 720000, 230400, 0xab9f953d
1, 729000, 4410, 0x6db5fdbd
1, 729000, 4410, 0xb760fed7
0, 729000, 230400, 0xa5f69795
1, 738000, 4410, 0x64c6b468
1, 738000, 4410, 0x05495a34
0, 738000, 230400, 0xa772950d
1, 747000, 4410, 0x1286686e
1, 747000, 4410, 0x6f203437
0, 747000, 230400, 0x6a5596d5
1, 756000, 4410, 0x76632813
1, 756000, 4410, 0x71299402
0, 756000, 230400, 0x1355958d
1, 765000, 4410, 0x9923669b
1, 765000, 4410, 0x72e7b346
0, 765000, 230400, 0x4134981d
1, 774000, 4410, 0x1cf31b5c
1, 774000, 4410, 0x879b0dae
0, 774000, 230400, 0x8b929515
1, 783000, 4410, 0xa9f14389
1, 783000, 4410, 0x041aa1bd
0, 783000, 230400, 0x482f95c5
1, 792000, 4410, 0x9438c5cc
1, 792000, 4410, 0x18a962e6
0, 792000, 230400, 0x7a9795d5
1, 801000, 4410, 0x48dd0a72
1, 801000, 4410, 0x21d20539
0, 801000, 230400, 0x21c29abd
1, 810000, 4410, 0xb0fe24dd
1, 810000, 4410, 0x8f449267
0, 810000, 230400, 0x9ae6a475
1, 819000, 4410, 0xdb9d03ac
1, 819000, 4410, 0xecdc01d6
0, 819000, 230400, 0x3734aee5
1, 828000, 4410, 0x487d7ac3
1, 828000, 4410, 0x458abd5a
0, 828000, 230400, 0xa0a1b365
1, 837000, 4410, 0x2b61d4d5
1, 837000, 4410, 0xa070ea63
0, 837000, 230400, 0x2dcab1c5
1, 846000, 4410, 0xab934d9c
1, 846000, 4410, 0xc25b26ce
0, 846000, 230400, 0x9c8b6c44
1, 855000, 4410, 0xd2ee6f94
1, 855000, 4410, 0x4d9237ca
0, 855000, 230400, 0x5da75feb
1, 864000, 4410, 0x012c3002
1, 864000, 4410, 0x748e1801
0, 864000, 230400, 0x4d02f8e3
1, 873000, 4410, 0xfccbd3cc
1, 873000, 4410, 0xc96b69e6
0, 873000, 230400, 0x66824f3a
1, 882000, 4410, 0xe53230d8
1, 882000, 4410, 0x6663186c
0, 882000, 230400, 0x0c9257e2
1, 891000, 4410, 0x2f6a6102
1, 891000, 4410, 0x7f6d3081
0, 891000, 230400, 0xb2927092
1, 900000, 4410, 0x77bb876a
1, 900000, 4410, 0x1a0343b5
0, 900000, 230400, 0xb5dc6e9a
1, 909000, 4410, 0xbcb76718
1, 909000, 4410, 0xc48e338c
0, 909000, 230400, 0x6e567bc6
1, 918000, 4410, 0x51c00790
1, 918000, 4410, 0x26fc03c8
0, 918000, 230400, 0xbf9e0f7a
1, 927000, 4410, 0x51b8fc5a
1, 927000, 4410, 0x69be7e2d
0, 927000, 230400, 0xb16f684a
1, 936000, 4410, 0x20fe9b42
1, 936000, 4410, 0x69a74da1
0, 936000, 230400, 0xf9e55e81
1, 945000, 4410, 0x363c5566
1, 945000, 4410, 0x85bd2ab3
0, 945000, 230400, 0xd8d0bcba
1, 954000, 4410, 0x3424a84c
1, 954000, 4410, 0xeff05426
0, 954000, 230400, 0x44720ac0
1, 963000, 4410, 0x7c3053c0
1, 963000, 4410, 0x292829e0
0, 963000, 230400, 0x7d4c2058
1, 972000, 4410, 0x368f2f30
1, 972000, 4410, 0x8f741798
0, 972000, 230400, 0xb0973eb9
1, 981000, 4410, 0x0f1e6fd2
1, 981000, 4410, 0x6b9337e9
0, 981000, 230400, 0x405a13ce
1, 990000, 4410, 0x3a1fe07e
1, 990000, 4410, 0xe4e1703f
0, 990000, 230400, 0x6422f00a
1, 999000, 4410, 0x74afd86a
1, 999000, 4410, 0x043d6c35
0, 999000, 230400, 0x924b6c1e
1, 1008000, 4410, 0xfdf911dd
1, 1008000, 4410, 0x3a8988e7
0, 1008000, 230400, 0xcf7809c0
1, 1017000, 4410, 0x1206a561
1, 1017000, 4410, 0x1fa7d2a9
0, 1017000, 230400, 0x883a3863
1, 1026000, 4410, 0x5f0f33d5
1, 1026000, 4410, 0xe28799e3
0, 1026000, 230400, 0x6adc9e03
1, 1035000, 4410, 0xca3d88e0
1, 1035000, 4410, 0xc2df4470
0, 1035000, 230400, 0x4f5ab7a8
1, 1044000, 4410, 0xdf8f19ea
1, 1044000, 4410, 0x694d0cf5
0, 1044000, 230400, 0xdc0aab94
1, 1053000, 4410, 0xe3275b9e
1, 1062000, 4410, 0xee1945c5
1, 1071000, 4410, 0x0afbd006
1, 1080000, 4410, 0x90ff8f14
1, 1089000, 4410, 0xfc0c887a
1, 1098000, 4410, 0xae9bc232
1, 1107000, 4410, 0x5f688eb8
1, 1116000, 4410, 0x9a307469
1, 1125000, 4410, 0x27f1e324
1, 1134000, 4410, 0x0c0d4ca2
1, 1143000, 4410, 0xd7e8ce74
1, 1152000, 4410, 0x16a4bfd6
1, 1161000, 4410, 0xbfb02f6d
1, 1170000, 4410, 0xf4b81a79
1, 1179000, 4410, 0x05d97288
1, 1188000, 4410, 0x3a7db4be
1, 1197000, 4410, 0xc6bea83e
1, 1206000, 4410, 0x436f62ed
1, 1215000, 4410, 0x6fabea0c
1, 1224000, 4410, 0x954878aa
1, 1233000, 4410, 0x4d10f579
1, 1242000, 4410, 0xac65932a
1, 1251000, 4410, 0x6889f957
1, 1260000, 4410, 0x65cf5830
1, 1269000, 4410, 0x87a7af71
1, 1278000, 4410, 0x82378c13
1, 1287000, 4410, 0x88ab6bd5
1, 1296000, 4410, 0xf90a3342
1, 1305000, 4410, 0xd790a1bc
1, 1314000, 4410, 0x89919d7c
1, 1323000, 4410, 0x7ffb22bf
1, 1332000, 4410, 0xfefbcce3
1, 1341000, 4410, 0x07714e80
1, 1350000, 4410, 0x73078f53
1, 1359000, 4410, 0x35c23078
1, 1368000, 4410, 0x452538bb
1, 1377000, 4410, 0x61493f33
1, 1386000, 4410, 0x2137c390
1, 1395000, 4410, 0x78c9393f
1, 1404000, 4410, 0x7aeaf8e1
1, 1413000, 4410, 0x4bb8da1c
1, 1422000, 4410, 0x5995dfc2
1, 1431000, 4410, 0xccce8872
1, 1440000, 4410, 0xca2753a4
1, 1449000, 4410, 0x4296ff6d
1, 1458000, 4410, 0xe582d191
1, 1467000, 4410, 0xc40268da
1, 1476000, 4410, 0xda1d475e
1, 1485000, 4410, 0x5e91e4e0
1, 1494000, 4410, 0xfeb44475
1, 1503000, 4410, 0x17ff8e38
1, 1512000, 4410, 0x3bd58bcf
1, 1521000, 4410, 0x9476e23c
1, 1530000, 4410, 0x440651ab
1, 1539000, 4410, 0xb08cdc74
1, 1548000, 4410, 0x6fc3031f
1, 1557000, 4410, 0x197ab39a
1, 1566000, 4410, 0xf92f0e3d
1, 1575000, 4410, 0xd5f6b678
1, 1584000, 4410, 0x8af127a6
1, 1593000, 4410, 0xe22f585e
1, 1602000, 4410, 0x67515610
1, 1611000, 4410, 0x21569d7a
1, 1620000, 4410, 0x114597d8
1, 1629000, 4410, 0xba213fb6
1, 1638000, 4410, 0x1aca9fee
1, 1647000, 4410, 0x48cdd264
1, 1656000, 4410, 0x533619ec
1, 1665000, 4410, 0x21466244
1, 1674000, 4410, 0x26e00e88
1, 1683000, 4410, 0x8e51d07c
1, 1692000, 4410, 0xa6c4048a
1, 1701000, 4410, 0x98ce10e4
1, 1710000, 4410, 0x379bc8c2
1, 1719000, 4410, 0x404b09c6
1, 1728000, 4410, 0xfc89da8a
1, 1737000, 4410, 0xbdbe6914
1, 1746000, 4410, 0x2cb09f08
1, 1755000, 4410, 0x835bf2d9
1, 1764000, 4410, 0xa4611790
1, 1773000, 4410, 0x67740896
1, 1782000, 4410, 0x489f6bd0
1, 1791000, 4410, 0x072bae9c
1, 1800000, 4410, 0xadce5a89
1, 1809000, 4410, 0x209f2c2c
1, 1818000, 4410, 0xf5706665
1, 1827000, 4410, 0x631841cb
1, 1836000, 4410, 0xa1a2c65f
1, 1845000, 4410, 0x8818b96b
1, 1854000, 4410, 0x63158025
1, 1863000, 4410, 0xf6ae79f5
1, 1872000, 4410, 0xb3dcd214
1, 1881000, 4410, 0x7a745449
1, 1890000, 4410, 0x5d2b15f4
1, 1899000, 4410, 0x48764b7c
1, 1908000, 4410, 0x1294e119
1, 1053000, 4410, 0x5aac2dcf
1, 1062000, 4410, 0x259fa2db
1, 1071000, 4410, 0xd16d6803
1, 1080000, 4410, 0xa4b3478a
1, 1089000, 4410, 0xdbe0443d
1, 1098000, 4410, 0x26c16119
1, 1107000, 4410, 0x0c06475c
1, 1116000, 4410, 0x6ffaba2d
1, 1125000, 4410, 0x5b287192
1, 1134000, 4410, 0xf2cf2651
1, 1143000, 4410, 0x3857673a
1, 1152000, 4410, 0x5b555feb
1, 1161000, 4410, 0x93f997af
1, 1170000, 4410, 0xb3ba8d35
1, 1179000, 4410, 0x66433944
1, 1188000, 4410, 0xf0005a5f
1, 1197000, 4410, 0xb948541f
1, 1206000, 4410, 0xc8f1b16f
1, 1215000, 4410, 0x7d4b7506
1, 1224000, 4410, 0xac723c55
1, 1233000, 4410, 0x2926fab5
1, 1242000, 4410, 0x31684995
1, 1251000, 4410, 0x35ebfca4
1, 1260000, 4410, 0x9cd42c18
1, 1269000, 4410, 0xd7ecd7b1
1, 1278000, 4410, 0x5e13c602
1, 1287000, 4410, 0xe955b5e3
1, 1296000, 4410, 0xefad19a1
1, 1305000, 4410, 0x435950de
1, 1314000, 4410, 0x9d624ebe
1, 1323000, 4410, 0x774a9158
1, 1332000, 4410, 0x8c41e66a
1, 1341000, 4410, 0x70112740
1, 1350000, 4410, 0x55abc7a2
1, 1359000, 4410, 0x0ec3183c
1, 1368000, 4410, 0x54609c56
1, 1377000, 4410, 0x60d49f92
1, 1386000, 4410, 0x5fb061c8
1, 1395000, 4410, 0x6e119c98
1, 1404000, 4410, 0x3f39fc69
1, 1413000, 4410, 0xef466d0e
1, 1422000, 4410, 0xf4cb6fe1
1, 1431000, 4410, 0xc4434439
1, 1440000, 4410, 0xd02329d2
1, 1449000, 4410, 0x216cffaf
1, 1458000, 4410, 0x7e59e8c1
1, 1467000, 4410, 0xc7c3346d
1, 1476000, 4410, 0x5b3723af
1, 1485000, 4410, 0x76097270
1, 1494000, 4410, 0xae39a233
1, 1503000, 4410, 0x686a471c
1, 1512000, 4410, 0x3af3c5e0
1, 1521000, 4410, 0x11ac711e
1, 1530000, 4410, 0xcd8da8ce
1, 1539000, 4410, 0x21296e3a
1, 1548000, 4410, 0x77168188
1, 1557000, 4410, 0x5fcf59cd
1, 1566000, 4410, 0x390c8717
1, 1575000, 4410, 0x3d5d5b3c
1, 1584000, 4410, 0x3b8f13d3
1, 1593000, 4410, 0x5b002c2f
1, 1602000, 4410, 0x9e1d2b08
1, 1611000, 4410, 0x69454ebd
1, 1620000, 4410, 0x62a54bec
1, 1629000, 4410, 0x4d231fdb
1, 1638000, 4410, 0x65624ff7
1, 1647000, 4410, 0x6fc66932
1, 1656000, 4410, 0x23200cf6
1, 1665000, 4410, 0xf8033122
1, 1674000, 4410, 0x0fce0744
1, 1683000, 4410, 0x9302683e
1, 1692000, 4410, 0xd2380245
1, 1701000, 4410, 0x482e0872
1, 1710000, 4410, 0xe98e6461
1, 1719000, 4410, 0x1db404e3
1, 1728000, 4410, 0x47a26d45
1, 1737000, 4410, 0x449a348a
1, 1746000, 4410, 0xee874f84
1, 1755000, 4410, 0xc4ecf965
1, 1764000, 4410, 0xcc450bc8
1, 1773000, 4410, 0xb18d044b
1, 1782000, 4410, 0x895435e8
1, 1791000, 4410, 0x57e7574e
1, 1800000, 4410, 0x8041ad3d
1, 1809000, 4410, 0x853d1616
1, 1818000, 4410, 0xa11bb32b
1, 1827000, 4410, 0xe10ea0de
1, 1836000, 4410, 0xdf2ee328
1, 1845000, 4410, 0xd5a6dcae
1, 1854000, 4410, 0xd176c00b
1, 1863000, 4410, 0x9cd6bcf3
1, 1872000, 4410, 0x2569690a
1, 1881000, 4410, 0x6824aa1d
1, 1890000, 4410, 0xa9110afa
1, 1899000, 4410, 0x115c25be
1, 1908000, 4410, 0x1100f085
1, 1917000, 4410, 0x00000000
1, 1926000, 4410, 0x00000000
1, 1935000, 4410, 0x00000000