Mercurial > libavcodec.hg
comparison mace.c @ 7816:e4b066e695b1 libavcodec
Cosmetics: s/short/int16_t/
author | vitor |
---|---|
date | Sun, 07 Sep 2008 14:33:01 +0000 |
parents | 275e43fa3dcb |
children | 0f3b77f8789d |
comparison
equal
deleted
inserted
replaced
7815:275e43fa3dcb | 7816:e4b066e695b1 |
---|---|
235 }; | 235 }; |
236 | 236 |
237 #define QT_8S_2_16S(x) (((x) & 0xFF00) | (((x) >> 8) & 0xFF)) | 237 #define QT_8S_2_16S(x) (((x) & 0xFF00) | (((x) >> 8) & 0xFF)) |
238 | 238 |
239 typedef struct ChannelData { | 239 typedef struct ChannelData { |
240 short index, lev, factor, prev2, previous, level; | 240 int16_t index, lev, factor, prev2, previous, level; |
241 } ChannelData; | 241 } ChannelData; |
242 | 242 |
243 typedef struct MACEContext { | 243 typedef struct MACEContext { |
244 ChannelData chd[2]; | 244 ChannelData chd[2]; |
245 } MACEContext; | 245 } MACEContext; |
261 static void chomp3(ChannelData *ctx, int16_t *output, uint8_t val, | 261 static void chomp3(ChannelData *ctx, int16_t *output, uint8_t val, |
262 const uint16_t tab1[], | 262 const uint16_t tab1[], |
263 const int16_t *tab2, int tab2_stride, | 263 const int16_t *tab2, int tab2_stride, |
264 uint32_t numChannels) | 264 uint32_t numChannels) |
265 { | 265 { |
266 short current; | 266 int16_t current; |
267 | 267 |
268 current = tab2[((ctx->index & 0x7f0) >> 4)*tab2_stride + val]; | 268 current = tab2[((ctx->index & 0x7f0) >> 4)*tab2_stride + val]; |
269 | 269 |
270 current = mace_broken_clip_int16(current + ctx->lev); | 270 current = mace_broken_clip_int16(current + ctx->lev); |
271 | 271 |
278 static void chomp6(ChannelData *ctx, int16_t *output, uint8_t val, | 278 static void chomp6(ChannelData *ctx, int16_t *output, uint8_t val, |
279 const uint16_t tab1[], | 279 const uint16_t tab1[], |
280 const int16_t *tab2, int tab2_stride, | 280 const int16_t *tab2, int tab2_stride, |
281 uint32_t numChannels) | 281 uint32_t numChannels) |
282 { | 282 { |
283 short current; | 283 int16_t current; |
284 | 284 |
285 current = tab2[((ctx->index & 0x7f0) >> 4)*tab2_stride + val]; | 285 current = tab2[((ctx->index & 0x7f0) >> 4)*tab2_stride + val]; |
286 | 286 |
287 if ((ctx->previous ^ current) >= 0) { | 287 if ((ctx->previous ^ current) >= 0) { |
288 ctx->factor = FFMIN(ctx->factor + 506, 32767); | 288 ctx->factor = FFMIN(ctx->factor + 506, 32767); |
319 | 319 |
320 static int mace3_decode_frame(AVCodecContext *avctx, | 320 static int mace3_decode_frame(AVCodecContext *avctx, |
321 void *data, int *data_size, | 321 void *data, int *data_size, |
322 const uint8_t *buf, int buf_size) | 322 const uint8_t *buf, int buf_size) |
323 { | 323 { |
324 short *samples = data; | 324 int16_t *samples = data; |
325 MACEContext *ctx = avctx->priv_data; | 325 MACEContext *ctx = avctx->priv_data; |
326 int i, j, k; | 326 int i, j, k; |
327 | 327 |
328 for(i = 0; i < avctx->channels; i++) { | 328 for(i = 0; i < avctx->channels; i++) { |
329 int16_t *output = samples + i; | 329 int16_t *output = samples + i; |
350 | 350 |
351 static int mace6_decode_frame(AVCodecContext *avctx, | 351 static int mace6_decode_frame(AVCodecContext *avctx, |
352 void *data, int *data_size, | 352 void *data, int *data_size, |
353 const uint8_t *buf, int buf_size) | 353 const uint8_t *buf, int buf_size) |
354 { | 354 { |
355 short *samples = data; | 355 int16_t *samples = data; |
356 MACEContext *ctx = avctx->priv_data; | 356 MACEContext *ctx = avctx->priv_data; |
357 int i, j; | 357 int i, j; |
358 | 358 |
359 for(i = 0; i < avctx->channels; i++) { | 359 for(i = 0; i < avctx->channels; i++) { |
360 int16_t *output = samples + i; | 360 int16_t *output = samples + i; |