• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

libavcodec/amr.h

Go to the documentation of this file.
00001 /*
00002  * Shared functions between AMR codecs
00003  *
00004  * Copyright (c) 2010 Marcelo Galvao Povoa
00005  *
00006  * This file is part of Libav.
00007  *
00008  * Libav is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2.1 of the License, or (at your option) any later version.
00012  *
00013  * Libav is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with Libav; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00021  */
00022 
00023 #ifndef AVCODEC_AMR_H
00024 #define AVCODEC_AMR_H
00025 
00026 #include "avcodec.h"
00027 
00028 #ifdef AMR_USE_16BIT_TABLES
00029 #define R_TABLE_TYPE uint16_t
00030 #else
00031 #define R_TABLE_TYPE uint8_t
00032 #endif
00033 
00049 static inline void ff_amr_bit_reorder(uint16_t *out, int size,
00050                                       const uint8_t *data,
00051                                       const R_TABLE_TYPE *ord_table)
00052 {
00053     int field_size;
00054 
00055     memset(out, 0, size);
00056     while ((field_size = *ord_table++)) {
00057         int field = 0;
00058         int field_offset = *ord_table++;
00059         while (field_size--) {
00060            int bit = *ord_table++;
00061            field <<= 1;
00062            field |= data[bit >> 3] >> (bit & 7) & 1;
00063         }
00064         out[field_offset] = field;
00065     }
00066 }
00067 
00068 #endif /* AVCODEC_AMR_H */
Generated on Sun Apr 22 2012 21:53:59 for Libav by doxygen 1.7.1