OSDN Git Service

Merge commit '4c995fafd861f537360b3717901cdbed6a6844e7'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 16 Oct 2012 11:19:11 +0000 (13:19 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 16 Oct 2012 11:20:46 +0000 (13:20 +0200)
* commit '4c995fafd861f537360b3717901cdbed6a6844e7':
  configure: simplify get_version() function
  build: support asan and tsan toolchain shortcuts
  rmdec: Move SIPR code shared with Matroska demuxer to a separate file

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
configure
libavformat/Makefile
libavformat/matroskadec.c
libavformat/rm.h
libavformat/rmdec.c
libavformat/rmsipr.c
libavformat/rmsipr.h

diff --cc configure
Simple merge
@@@ -265,9 -241,8 +265,9 @@@ OBJS-$(CONFIG_QCP_DEMUXER
  OBJS-$(CONFIG_R3D_DEMUXER)               += r3d.o
  OBJS-$(CONFIG_RAWVIDEO_DEMUXER)          += rawvideodec.o rawdec.o
  OBJS-$(CONFIG_RAWVIDEO_MUXER)            += rawenc.o
 +OBJS-$(CONFIG_REALTEXT_DEMUXER)          += realtextdec.o
  OBJS-$(CONFIG_RL2_DEMUXER)               += rl2.o
- OBJS-$(CONFIG_RM_DEMUXER)                += rmdec.o rm.o
+ OBJS-$(CONFIG_RM_DEMUXER)                += rmdec.o rm.o rmsipr.o
  OBJS-$(CONFIG_RM_MUXER)                  += rmenc.o rm.o
  OBJS-$(CONFIG_ROQ_DEMUXER)               += idroqdec.o
  OBJS-$(CONFIG_ROQ_MUXER)                 += idroqenc.o rawenc.o
Simple merge
Simple merge
Simple merge
index 0000000,89fbd0e..14ec8ea
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,61 +1,61 @@@
 - * This file is part of Libav.
+ /*
+  * tables and functions for demuxing SIPR audio muxed RealMedia style
+  *
 - * Libav is free software; you can redistribute it and/or
++ * This file is part of FFmpeg.
+  *
 - * Libav is distributed in the hope that it will be useful,
++ * FFmpeg is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public
+  * License as published by the Free Software Foundation; either
+  * version 2.1 of the License, or (at your option) any later version.
+  *
 - * License along with Libav; if not, write to the Free Software
++ * FFmpeg is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
++ * License along with FFmpeg; if not, write to the Free Software
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+  */
+ #include <stdint.h>
+ #include "rmsipr.h"
+ const unsigned char ff_sipr_subpk_size[4] = { 29, 19, 37, 20 };
+ static const unsigned char sipr_swaps[38][2] = {
+     {  0, 63 }, {  1, 22 }, {  2, 44 }, {  3, 90 },
+     {  5, 81 }, {  7, 31 }, {  8, 86 }, {  9, 58 },
+     { 10, 36 }, { 12, 68 }, { 13, 39 }, { 14, 73 },
+     { 15, 53 }, { 16, 69 }, { 17, 57 }, { 19, 88 },
+     { 20, 34 }, { 21, 71 }, { 24, 46 }, { 25, 94 },
+     { 26, 54 }, { 28, 75 }, { 29, 50 }, { 32, 70 },
+     { 33, 92 }, { 35, 74 }, { 38, 85 }, { 40, 56 },
+     { 42, 87 }, { 43, 65 }, { 45, 59 }, { 48, 79 },
+     { 49, 93 }, { 51, 89 }, { 55, 95 }, { 61, 76 },
+     { 67, 83 }, { 77, 80 }
+ };
+ /* This can be optimized, e.g. use memcpy() if data blocks are aligned. */
+ void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize)
+ {
+     int n, bs = sub_packet_h * framesize * 2 / 96; // nibbles per subpacket
+     for (n = 0; n < 38; n++) {
+         int j;
+         int i = bs * sipr_swaps[n][0];
+         int o = bs * sipr_swaps[n][1];
+         /* swap 4bit-nibbles of block 'i' with 'o' */
+         for (j = 0; j < bs; j++, i++, o++) {
+             int x = (buf[i >> 1] >> (4 * (i & 1))) & 0xF,
+                 y = (buf[o >> 1] >> (4 * (o & 1))) & 0xF;
+             buf[o >> 1] = (x << (4 * (o & 1))) |
+                 (buf[o >> 1] & (0xF << (4 * !(o & 1))));
+             buf[i >> 1] = (y << (4 * (i & 1))) |
+                 (buf[i >> 1] & (0xF << (4 * !(i & 1))));
+         }
+     }
+ }
index 0000000,c8d3d0a..2837336
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,35 +1,35 @@@
 - * This file is part of Libav.
+ /*
+  * tables and functions for demuxing SIPR audio muxed RealMedia style
+  *
 - * Libav is free software; you can redistribute it and/or
++ * This file is part of FFmpeg.
+  *
 - * Libav is distributed in the hope that it will be useful,
++ * FFmpeg is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public
+  * License as published by the Free Software Foundation; either
+  * version 2.1 of the License, or (at your option) any later version.
+  *
 - * License along with Libav; if not, write to the Free Software
++ * FFmpeg is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  * Lesser General Public License for more details.
+  *
+  * You should have received a copy of the GNU Lesser General Public
++ * License along with FFmpeg; if not, write to the Free Software
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+  */
+ #ifndef AVFORMAT_RMSIPR_H
+ #define AVFORMAT_RMSIPR_H
+ #include <stdint.h>
+ extern const unsigned char ff_sipr_subpk_size[4];
+ /**
+  * Perform 4-bit block reordering for SIPR data.
+  *
+  * @param buf SIPR data
+  */
+ void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize);
+ #endif /* AVFORMAT_RMSIPR_H */