diff options
Diffstat (limited to 'apps/codecs/libwavpack/words.c')
-rw-r--r-- | apps/codecs/libwavpack/words.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/apps/codecs/libwavpack/words.c b/apps/codecs/libwavpack/words.c index c7a8047d03..ccbd77f8f9 100644 --- a/apps/codecs/libwavpack/words.c +++ b/apps/codecs/libwavpack/words.c | |||
@@ -151,14 +151,14 @@ int read_entropy_vars (WavpackStream *wps, WavpackMetadata *wpmd) | |||
151 | { | 151 | { |
152 | uchar *byteptr = wpmd->data; | 152 | uchar *byteptr = wpmd->data; |
153 | 153 | ||
154 | if (wpmd->byte_length != ((wps->wphdr.flags & MONO_DATA) ? 6 : 12)) | 154 | if (wpmd->byte_length != ((wps->wphdr.flags & MONO_FLAG) ? 6 : 12)) |
155 | return FALSE; | 155 | return FALSE; |
156 | 156 | ||
157 | wps->w.c [0].median [0] = exp2s (byteptr [0] + (byteptr [1] << 8)); | 157 | wps->w.c [0].median [0] = exp2s (byteptr [0] + (byteptr [1] << 8)); |
158 | wps->w.c [0].median [1] = exp2s (byteptr [2] + (byteptr [3] << 8)); | 158 | wps->w.c [0].median [1] = exp2s (byteptr [2] + (byteptr [3] << 8)); |
159 | wps->w.c [0].median [2] = exp2s (byteptr [4] + (byteptr [5] << 8)); | 159 | wps->w.c [0].median [2] = exp2s (byteptr [4] + (byteptr [5] << 8)); |
160 | 160 | ||
161 | if (!(wps->wphdr.flags & MONO_DATA)) { | 161 | if (!(wps->wphdr.flags & MONO_FLAG)) { |
162 | wps->w.c [1].median [0] = exp2s (byteptr [6] + (byteptr [7] << 8)); | 162 | wps->w.c [1].median [0] = exp2s (byteptr [6] + (byteptr [7] << 8)); |
163 | wps->w.c [1].median [1] = exp2s (byteptr [8] + (byteptr [9] << 8)); | 163 | wps->w.c [1].median [1] = exp2s (byteptr [8] + (byteptr [9] << 8)); |
164 | wps->w.c [1].median [2] = exp2s (byteptr [10] + (byteptr [11] << 8)); | 164 | wps->w.c [1].median [2] = exp2s (byteptr [10] + (byteptr [11] << 8)); |
@@ -215,7 +215,7 @@ int read_hybrid_profile (WavpackStream *wps, WavpackMetadata *wpmd) | |||
215 | wps->w.c [0].slow_level = exp2s (byteptr [0] + (byteptr [1] << 8)); | 215 | wps->w.c [0].slow_level = exp2s (byteptr [0] + (byteptr [1] << 8)); |
216 | byteptr += 2; | 216 | byteptr += 2; |
217 | 217 | ||
218 | if (!(wps->wphdr.flags & MONO_DATA)) { | 218 | if (!(wps->wphdr.flags & MONO_FLAG)) { |
219 | wps->w.c [1].slow_level = exp2s (byteptr [0] + (byteptr [1] << 8)); | 219 | wps->w.c [1].slow_level = exp2s (byteptr [0] + (byteptr [1] << 8)); |
220 | byteptr += 2; | 220 | byteptr += 2; |
221 | } | 221 | } |
@@ -224,7 +224,7 @@ int read_hybrid_profile (WavpackStream *wps, WavpackMetadata *wpmd) | |||
224 | wps->w.bitrate_acc [0] = (int32_t)(byteptr [0] + (byteptr [1] << 8)) << 16; | 224 | wps->w.bitrate_acc [0] = (int32_t)(byteptr [0] + (byteptr [1] << 8)) << 16; |
225 | byteptr += 2; | 225 | byteptr += 2; |
226 | 226 | ||
227 | if (!(wps->wphdr.flags & MONO_DATA)) { | 227 | if (!(wps->wphdr.flags & MONO_FLAG)) { |
228 | wps->w.bitrate_acc [1] = (int32_t)(byteptr [0] + (byteptr [1] << 8)) << 16; | 228 | wps->w.bitrate_acc [1] = (int32_t)(byteptr [0] + (byteptr [1] << 8)) << 16; |
229 | byteptr += 2; | 229 | byteptr += 2; |
230 | } | 230 | } |
@@ -233,7 +233,7 @@ int read_hybrid_profile (WavpackStream *wps, WavpackMetadata *wpmd) | |||
233 | wps->w.bitrate_delta [0] = exp2s ((short)(byteptr [0] + (byteptr [1] << 8))); | 233 | wps->w.bitrate_delta [0] = exp2s ((short)(byteptr [0] + (byteptr [1] << 8))); |
234 | byteptr += 2; | 234 | byteptr += 2; |
235 | 235 | ||
236 | if (!(wps->wphdr.flags & MONO_DATA)) { | 236 | if (!(wps->wphdr.flags & MONO_FLAG)) { |
237 | wps->w.bitrate_delta [1] = exp2s ((short)(byteptr [0] + (byteptr [1] << 8))); | 237 | wps->w.bitrate_delta [1] = exp2s ((short)(byteptr [0] + (byteptr [1] << 8))); |
238 | byteptr += 2; | 238 | byteptr += 2; |
239 | } | 239 | } |
@@ -257,7 +257,7 @@ void update_error_limit (struct words_data *w, uint32_t flags) | |||
257 | { | 257 | { |
258 | int bitrate_0 = (w->bitrate_acc [0] += w->bitrate_delta [0]) >> 16; | 258 | int bitrate_0 = (w->bitrate_acc [0] += w->bitrate_delta [0]) >> 16; |
259 | 259 | ||
260 | if (flags & MONO_DATA) { | 260 | if (flags & MONO_FLAG) { |
261 | if (flags & HYBRID_BITRATE) { | 261 | if (flags & HYBRID_BITRATE) { |
262 | int slow_log_0 = (w->c [0].slow_level + SLO) >> SLS; | 262 | int slow_log_0 = (w->c [0].slow_level + SLO) >> SLS; |
263 | 263 | ||
@@ -326,13 +326,13 @@ int32_t get_words (int32_t *buffer, int nsamples, uint32_t flags, | |||
326 | register struct entropy_data *c = w->c; | 326 | register struct entropy_data *c = w->c; |
327 | int csamples; | 327 | int csamples; |
328 | 328 | ||
329 | if (!(flags & MONO_DATA)) | 329 | if (!(flags & MONO_FLAG)) |
330 | nsamples *= 2; | 330 | nsamples *= 2; |
331 | 331 | ||
332 | for (csamples = 0; csamples < nsamples; ++csamples) { | 332 | for (csamples = 0; csamples < nsamples; ++csamples) { |
333 | uint32_t ones_count, low, mid, high; | 333 | uint32_t ones_count, low, mid, high; |
334 | 334 | ||
335 | if (!(flags & MONO_DATA)) | 335 | if (!(flags & MONO_FLAG)) |
336 | c = w->c + (csamples & 1); | 336 | c = w->c + (csamples & 1); |
337 | 337 | ||
338 | if (!(w->c [0].median [0] & ~1) && !w->holding_zero && !w->holding_one && !(w->c [1].median [0] & ~1)) { | 338 | if (!(w->c [0].median [0] & ~1) && !w->holding_zero && !w->holding_one && !(w->c [1].median [0] & ~1)) { |
@@ -435,7 +435,7 @@ int32_t get_words (int32_t *buffer, int nsamples, uint32_t flags, | |||
435 | w->holding_zero = ~w->holding_one & 1; | 435 | w->holding_zero = ~w->holding_one & 1; |
436 | } | 436 | } |
437 | 437 | ||
438 | if ((flags & HYBRID_FLAG) && ((flags & MONO_DATA) || !(csamples & 1))) | 438 | if ((flags & HYBRID_FLAG) && ((flags & MONO_FLAG) || !(csamples & 1))) |
439 | update_error_limit (w, flags); | 439 | update_error_limit (w, flags); |
440 | 440 | ||
441 | if (ones_count == 0) { | 441 | if (ones_count == 0) { |
@@ -484,7 +484,7 @@ int32_t get_words (int32_t *buffer, int nsamples, uint32_t flags, | |||
484 | c->slow_level = c->slow_level - ((c->slow_level + SLO) >> SLS) + mylog2 (mid); | 484 | c->slow_level = c->slow_level - ((c->slow_level + SLO) >> SLS) + mylog2 (mid); |
485 | } | 485 | } |
486 | 486 | ||
487 | return (flags & MONO_DATA) ? csamples : (csamples / 2); | 487 | return (flags & MONO_FLAG) ? csamples : (csamples / 2); |
488 | } | 488 | } |
489 | 489 | ||
490 | // Read a single unsigned value from the specified bitstream with a value | 490 | // Read a single unsigned value from the specified bitstream with a value |