40 -9, -8, -6, -5, -4, -3, -2, -1,
41 0, 1, 2, 3, 4, 5, 6, 8
58 int buf_size = avpkt->
size;
60 int in_size, out_size, ret;
77 if (in_size > buf_size) {
88 samples = frame->
data[0];
89 samples_end = samples + out_size;
91 if (in_size == out_size) {
92 memcpy(samples, buf, out_size);
97 while (samples < samples_end && buf - avpkt->data < buf_size) {
106 case 0: smp = 4 * (count + 1);
break;
107 case 1: smp = 2 * (count + 1);
break;
108 case 2: smp = (count & 0x20) ? 1 : count + 1;
break;
109 default: smp = count + 1;
break;
111 if (samples_end - samples < smp)
115 size = ((code == 2 && (count & 0x20)) || code == 3) ? 0 : count + 1;
116 if ((buf - avpkt->
data) + size > buf_size)
121 for (count++; count > 0; count--) {
123 sample += ( code & 0x3) - 2;
124 sample = av_clip_uint8(sample);
126 sample += ((code >> 2) & 0x3) - 2;
127 sample = av_clip_uint8(sample);
129 sample += ((code >> 4) & 0x3) - 2;
130 sample = av_clip_uint8(sample);
132 sample += (code >> 6) - 2;
133 sample = av_clip_uint8(sample);
138 for (count++; count > 0; count--) {
141 sample = av_clip_uint8(sample);
144 sample = av_clip_uint8(sample);
154 sample = av_clip_uint8(sample);
157 memcpy(samples, buf, smp);
164 memset(samples, sample, smp);