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) {
86 samples = frame->
data[0];
87 samples_end = samples + out_size;
89 if (in_size == out_size) {
90 memcpy(samples, buf, out_size);
95 while (samples < samples_end && buf - avpkt->data < buf_size) {
104 case 0: smp = 4 * (count + 1);
break;
105 case 1: smp = 2 * (count + 1);
break;
106 case 2: smp = (count & 0x20) ? 1 : count + 1;
break;
107 default: smp = count + 1;
break;
109 if (samples_end - samples < smp)
113 size = ((code == 2 && (count & 0x20)) || code == 3) ? 0 : count + 1;
114 if ((buf - avpkt->
data) + size > buf_size)
119 for (count++; count > 0; count--) {
121 sample += ( code & 0x3) - 2;
122 sample = av_clip_uint8(sample);
124 sample += ((code >> 2) & 0x3) - 2;
125 sample = av_clip_uint8(sample);
127 sample += ((code >> 4) & 0x3) - 2;
128 sample = av_clip_uint8(sample);
130 sample += (code >> 6) - 2;
131 sample = av_clip_uint8(sample);
136 for (count++; count > 0; count--) {
139 sample = av_clip_uint8(sample);
142 sample = av_clip_uint8(sample);
152 sample = av_clip_uint8(sample);
155 memcpy(samples, buf, smp);
162 memset(samples, sample, smp);