comparison alsdec.c @ 12024:fdafbcef52f5 libavcodec

Fix grammar errors in documentation
author mru
date Wed, 30 Jun 2010 15:38:06 +0000
parents ebef2d6d5a8e
children 3798d134f330
comparison
equal deleted inserted replaced
12023:c7455450364d 12024:fdafbcef52f5
269 dprintf(avctx, "chan_config_info = %i\n", sconf->chan_config_info); 269 dprintf(avctx, "chan_config_info = %i\n", sconf->chan_config_info);
270 #endif 270 #endif
271 } 271 }
272 272
273 273
274 /** Reads an ALSSpecificConfig from a buffer into the output struct. 274 /** Read an ALSSpecificConfig from a buffer into the output struct.
275 */ 275 */
276 static av_cold int read_specific_config(ALSDecContext *ctx) 276 static av_cold int read_specific_config(ALSDecContext *ctx)
277 { 277 {
278 GetBitContext gb; 278 GetBitContext gb;
279 uint64_t ht_size; 279 uint64_t ht_size;
404 404
405 return 0; 405 return 0;
406 } 406 }
407 407
408 408
409 /** Checks the ALSSpecificConfig for unsupported features. 409 /** Check the ALSSpecificConfig for unsupported features.
410 */ 410 */
411 static int check_specific_config(ALSDecContext *ctx) 411 static int check_specific_config(ALSDecContext *ctx)
412 { 412 {
413 ALSSpecificConfig *sconf = &ctx->sconf; 413 ALSSpecificConfig *sconf = &ctx->sconf;
414 int error = 0; 414 int error = 0;
428 428
429 return error; 429 return error;
430 } 430 }
431 431
432 432
433 /** Parses the bs_info field to extract the block partitioning used in 433 /** Parse the bs_info field to extract the block partitioning used in
434 * block switching mode, refer to ISO/IEC 14496-3, section 11.6.2. 434 * block switching mode, refer to ISO/IEC 14496-3, section 11.6.2.
435 */ 435 */
436 static void parse_bs_info(const uint32_t bs_info, unsigned int n, 436 static void parse_bs_info(const uint32_t bs_info, unsigned int n,
437 unsigned int div, unsigned int **div_blocks, 437 unsigned int div, unsigned int **div_blocks,
438 unsigned int *num_blocks) 438 unsigned int *num_blocks)
452 (*num_blocks)++; 452 (*num_blocks)++;
453 } 453 }
454 } 454 }
455 455
456 456
457 /** Reads and decodes a Rice codeword. 457 /** Read and decodes a Rice codeword.
458 */ 458 */
459 static int32_t decode_rice(GetBitContext *gb, unsigned int k) 459 static int32_t decode_rice(GetBitContext *gb, unsigned int k)
460 { 460 {
461 int max = get_bits_left(gb) - k; 461 int max = get_bits_left(gb) - k;
462 int q = get_unary(gb, 0, max); 462 int q = get_unary(gb, 0, max);
470 } 470 }
471 return r ? q : ~q; 471 return r ? q : ~q;
472 } 472 }
473 473
474 474
475 /** Converts PARCOR coefficient k to direct filter coefficient. 475 /** Convert PARCOR coefficient k to direct filter coefficient.
476 */ 476 */
477 static void parcor_to_lpc(unsigned int k, const int32_t *par, int32_t *cof) 477 static void parcor_to_lpc(unsigned int k, const int32_t *par, int32_t *cof)
478 { 478 {
479 int i, j; 479 int i, j;
480 480
488 488
489 cof[k] = par[k]; 489 cof[k] = par[k];
490 } 490 }
491 491
492 492
493 /** Reads block switching field if necessary and sets actual block sizes. 493 /** Read block switching field if necessary and sets actual block sizes.
494 * Also assures that the block sizes of the last frame correspond to the 494 * Also assures that the block sizes of the last frame correspond to the
495 * actual number of samples. 495 * actual number of samples.
496 */ 496 */
497 static void get_block_sizes(ALSDecContext *ctx, unsigned int *div_blocks, 497 static void get_block_sizes(ALSDecContext *ctx, unsigned int *div_blocks,
498 uint32_t *bs_info) 498 uint32_t *bs_info)
543 } 543 }
544 } 544 }
545 } 545 }
546 546
547 547
548 /** Reads the block data for a constant block 548 /** Read the block data for a constant block
549 */ 549 */
550 static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd) 550 static void read_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
551 { 551 {
552 ALSSpecificConfig *sconf = &ctx->sconf; 552 ALSSpecificConfig *sconf = &ctx->sconf;
553 AVCodecContext *avctx = ctx->avctx; 553 AVCodecContext *avctx = ctx->avctx;
568 // ensure constant block decoding by reusing this field 568 // ensure constant block decoding by reusing this field
569 bd->const_block = 1; 569 bd->const_block = 1;
570 } 570 }
571 571
572 572
573 /** Decodes the block data for a constant block 573 /** Decode the block data for a constant block
574 */ 574 */
575 static void decode_const_block_data(ALSDecContext *ctx, ALSBlockData *bd) 575 static void decode_const_block_data(ALSDecContext *ctx, ALSBlockData *bd)
576 { 576 {
577 int smp = bd->block_length; 577 int smp = bd->block_length;
578 int32_t val = bd->const_val; 578 int32_t val = bd->const_val;
582 for (; smp; smp--) 582 for (; smp; smp--)
583 *dst++ = val; 583 *dst++ = val;
584 } 584 }
585 585
586 586
587 /** Reads the block data for a non-constant block 587 /** Read the block data for a non-constant block
588 */ 588 */
589 static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) 589 static int read_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
590 { 590 {
591 ALSSpecificConfig *sconf = &ctx->sconf; 591 ALSSpecificConfig *sconf = &ctx->sconf;
592 AVCodecContext *avctx = ctx->avctx; 592 AVCodecContext *avctx = ctx->avctx;
829 829
830 return 0; 830 return 0;
831 } 831 }
832 832
833 833
834 /** Decodes the block data for a non-constant block 834 /** Decode the block data for a non-constant block
835 */ 835 */
836 static int decode_var_block_data(ALSDecContext *ctx, ALSBlockData *bd) 836 static int decode_var_block_data(ALSDecContext *ctx, ALSBlockData *bd)
837 { 837 {
838 ALSSpecificConfig *sconf = &ctx->sconf; 838 ALSSpecificConfig *sconf = &ctx->sconf;
839 unsigned int block_length = bd->block_length; 839 unsigned int block_length = bd->block_length;
938 938
939 return 0; 939 return 0;
940 } 940 }
941 941
942 942
943 /** Reads the block data. 943 /** Read the block data.
944 */ 944 */
945 static int read_block(ALSDecContext *ctx, ALSBlockData *bd) 945 static int read_block(ALSDecContext *ctx, ALSBlockData *bd)
946 { 946 {
947 GetBitContext *gb = &ctx->gb; 947 GetBitContext *gb = &ctx->gb;
948 948
956 956
957 return 0; 957 return 0;
958 } 958 }
959 959
960 960
961 /** Decodes the block data. 961 /** Decode the block data.
962 */ 962 */
963 static int decode_block(ALSDecContext *ctx, ALSBlockData *bd) 963 static int decode_block(ALSDecContext *ctx, ALSBlockData *bd)
964 { 964 {
965 unsigned int smp; 965 unsigned int smp;
966 966
978 978
979 return 0; 979 return 0;
980 } 980 }
981 981
982 982
983 /** Reads and decodes block data successively. 983 /** Read and decodes block data successively.
984 */ 984 */
985 static int read_decode_block(ALSDecContext *ctx, ALSBlockData *bd) 985 static int read_decode_block(ALSDecContext *ctx, ALSBlockData *bd)
986 { 986 {
987 int ret; 987 int ret;
988 988
995 995
996 return ret; 996 return ret;
997 } 997 }
998 998
999 999
1000 /** Computes the number of samples left to decode for the current frame and 1000 /** Compute the number of samples left to decode for the current frame and
1001 * sets these samples to zero. 1001 * sets these samples to zero.
1002 */ 1002 */
1003 static void zero_remaining(unsigned int b, unsigned int b_max, 1003 static void zero_remaining(unsigned int b, unsigned int b_max,
1004 const unsigned int *div_blocks, int32_t *buf) 1004 const unsigned int *div_blocks, int32_t *buf)
1005 { 1005 {
1011 if (count) 1011 if (count)
1012 memset(buf, 0, sizeof(*buf) * count); 1012 memset(buf, 0, sizeof(*buf) * count);
1013 } 1013 }
1014 1014
1015 1015
1016 /** Decodes blocks independently. 1016 /** Decode blocks independently.
1017 */ 1017 */
1018 static int decode_blocks_ind(ALSDecContext *ctx, unsigned int ra_frame, 1018 static int decode_blocks_ind(ALSDecContext *ctx, unsigned int ra_frame,
1019 unsigned int c, const unsigned int *div_blocks, 1019 unsigned int c, const unsigned int *div_blocks,
1020 unsigned int *js_blocks) 1020 unsigned int *js_blocks)
1021 { 1021 {
1049 1049
1050 return 0; 1050 return 0;
1051 } 1051 }
1052 1052
1053 1053
1054 /** Decodes blocks dependently. 1054 /** Decode blocks dependently.
1055 */ 1055 */
1056 static int decode_blocks(ALSDecContext *ctx, unsigned int ra_frame, 1056 static int decode_blocks(ALSDecContext *ctx, unsigned int ra_frame,
1057 unsigned int c, const unsigned int *div_blocks, 1057 unsigned int c, const unsigned int *div_blocks,
1058 unsigned int *js_blocks) 1058 unsigned int *js_blocks)
1059 { 1059 {
1130 1130
1131 return 0; 1131 return 0;
1132 } 1132 }
1133 1133
1134 1134
1135 /** Reads the channel data. 1135 /** Read the channel data.
1136 */ 1136 */
1137 static int read_channel_data(ALSDecContext *ctx, ALSChannelData *cd, int c) 1137 static int read_channel_data(ALSDecContext *ctx, ALSChannelData *cd, int c)
1138 { 1138 {
1139 GetBitContext *gb = &ctx->gb; 1139 GetBitContext *gb = &ctx->gb;
1140 ALSChannelData *current = cd; 1140 ALSChannelData *current = cd;
1258 1258
1259 return 0; 1259 return 0;
1260 } 1260 }
1261 1261
1262 1262
1263 /** Reads the frame data. 1263 /** Read the frame data.
1264 */ 1264 */
1265 static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame) 1265 static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
1266 { 1266 {
1267 ALSSpecificConfig *sconf = &ctx->sconf; 1267 ALSSpecificConfig *sconf = &ctx->sconf;
1268 AVCodecContext *avctx = ctx->avctx; 1268 AVCodecContext *avctx = ctx->avctx;
1387 1387
1388 return 0; 1388 return 0;
1389 } 1389 }
1390 1390
1391 1391
1392 /** Decodes an ALS frame. 1392 /** Decode an ALS frame.
1393 */ 1393 */
1394 static int decode_frame(AVCodecContext *avctx, 1394 static int decode_frame(AVCodecContext *avctx,
1395 void *data, int *data_size, 1395 void *data, int *data_size,
1396 AVPacket *avpkt) 1396 AVPacket *avpkt)
1397 { 1397 {
1509 1509
1510 return bytes_read; 1510 return bytes_read;
1511 } 1511 }
1512 1512
1513 1513
1514 /** Uninitializes the ALS decoder. 1514 /** Uninitialize the ALS decoder.
1515 */ 1515 */
1516 static av_cold int decode_end(AVCodecContext *avctx) 1516 static av_cold int decode_end(AVCodecContext *avctx)
1517 { 1517 {
1518 ALSDecContext *ctx = avctx->priv_data; 1518 ALSDecContext *ctx = avctx->priv_data;
1519 1519
1539 1539
1540 return 0; 1540 return 0;
1541 } 1541 }
1542 1542
1543 1543
1544 /** Initializes the ALS decoder. 1544 /** Initialize the ALS decoder.
1545 */ 1545 */
1546 static av_cold int decode_init(AVCodecContext *avctx) 1546 static av_cold int decode_init(AVCodecContext *avctx)
1547 { 1547 {
1548 unsigned int c; 1548 unsigned int c;
1549 unsigned int channel_size; 1549 unsigned int channel_size;
1691 1691
1692 return 0; 1692 return 0;
1693 } 1693 }
1694 1694
1695 1695
1696 /** Flushes (resets) the frame ID after seeking. 1696 /** Flush (reset) the frame ID after seeking.
1697 */ 1697 */
1698 static av_cold void flush(AVCodecContext *avctx) 1698 static av_cold void flush(AVCodecContext *avctx)
1699 { 1699 {
1700 ALSDecContext *ctx = avctx->priv_data; 1700 ALSDecContext *ctx = avctx->priv_data;
1701 1701