40 -9, -8, -6, -5, -4, -3, -2, -1,
41 0, 1, 2, 3, 4, 5, 6, 8
67 int buf_size = avpkt->
size;
69 int in_size, out_size, ret;
86 if (in_size > buf_size) {
98 samples_end = samples + out_size;
100 if (in_size == out_size) {
101 memcpy(samples, buf, out_size);
107 while (samples < samples_end && buf - avpkt->data < buf_size) {
116 case 0: smp = 4 * (count + 1);
break;
117 case 1: smp = 2 * (count + 1);
break;
118 case 2: smp = (count & 0x20) ? 1 : count + 1;
break;
119 default: smp = count + 1;
break;
121 if (samples_end - samples < smp)
125 size = ((code == 2 && (count & 0x20)) || code == 3) ? 0 : count + 1;
126 if ((buf - avpkt->
data) + size > buf_size)
131 for (count++; count > 0; count--) {
133 sample += ( code & 0x3) - 2;
134 sample = av_clip_uint8(sample);
136 sample += ((code >> 2) & 0x3) - 2;
137 sample = av_clip_uint8(sample);
139 sample += ((code >> 4) & 0x3) - 2;
140 sample = av_clip_uint8(sample);
142 sample += (code >> 6) - 2;
143 sample = av_clip_uint8(sample);
148 for (count++; count > 0; count--) {
151 sample = av_clip_uint8(sample);
154 sample = av_clip_uint8(sample);
164 sample = av_clip_uint8(sample);
167 memcpy(samples, buf, smp);
174 memset(samples, sample, smp);