History

adpcmenc: Use correct frame_size for Yamaha ADPCM.

Output packet size should match avctx->block_align. The target output packet size is 1024 bytes. Before: mono - 1024 samples -> 512 bytes stereo - 2048 samples -> 2048 bytes After: mono - 2048 samples -> 1024 bytes stereo - 1024 samples -> 1024 bytes

Justin Ruggles committed 14 years ago

Commit 770a5c61 parent 91a28b02 files · +5 −5Browse files

Unified · Split

2 files
  1. libavcodec/adpcmenc.c +1 −1
  2. tests/ref/acodec/adpcm_yam +4 −4
libavcodec/adpcmenc.c+1−1
@@ -122,7 +122,7 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx) · 121 unmodified lines
122122 }
123123 break;
124124 case CODEC_ID_ADPCM_YAMAHA:
125− avctx->frame_size = BLKSIZE * avctx->channels;
125+ avctx->frame_size = BLKSIZE * 2 / avctx->channels;
126126 avctx->block_align = BLKSIZE;
127127 break;
128128 case CODEC_ID_ADPCM_SWF:
tests/ref/acodec/adpcm_yam+4−4
@@ -1,4 +1,4 @@
1−006f8dc92eb4f7bab82eded314ca1124 *./tests/data/acodec/adpcm_yam.wav
2−266298 ./tests/data/acodec/adpcm_yam.wav
3−c36a9d5a1e0ad57fbe9665a31373b7c1 *./tests/data/adpcm_yam.acodec.out.wav
4−stddev: 1247.60 PSNR: 34.41 MAXDIFF:39895 bytes: 1064960/ 1058400
1+e9c14f701d25947317db9367b9dc772d *./tests/data/acodec/adpcm_yam.wav
2+265274 ./tests/data/acodec/adpcm_yam.wav
3+1488b5974fa040a65f0d407fc0224c6a *./tests/data/adpcm_yam.acodec.out.wav
4+stddev: 1247.60 PSNR: 34.41 MAXDIFF:39895 bytes: 1060864/ 1058400

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