[FFmpeg-cvslog] Merge commit 'a7da517f6a5c472f46f67dd33bb6b95ccc919923'
Derek Buitenhuis
git at videolan.org
Sun Apr 24 13:01:44 CEST 2016
ffmpeg | branch: master | Derek Buitenhuis <derek.buitenhuis at gmail.com> | Sun Apr 24 11:54:53 2016 +0100| [9809371aa5402d724cfaf74236bfe2ddb9829676] | committer: Derek Buitenhuis
Merge commit 'a7da517f6a5c472f46f67dd33bb6b95ccc919923'
* commit 'a7da517f6a5c472f46f67dd33bb6b95ccc919923':
h264data: Move all data tables from a header to a .c file
Merged-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9809371aa5402d724cfaf74236bfe2ddb9829676
---
libavcodec/Makefile | 2 +-
libavcodec/dxva2_h264.c | 2 +-
libavcodec/h264_cabac.c | 27 +++++----
libavcodec/h264_cavlc.c | 36 +++++------
libavcodec/h264_parser.c | 2 +-
libavcodec/h264_slice.c | 2 +-
libavcodec/h264data.c | 149 ++++++++++++++++++++++++++++++++++++++++++++++
libavcodec/h264data.h | 132 ++++------------------------------------
libavcodec/svq3.c | 16 +++--
9 files changed, 203 insertions(+), 165 deletions(-)
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index bc4c97f..679f2f2 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -308,7 +308,7 @@ OBJS-$(CONFIG_H263_ENCODER) += mpeg4videoenc.o mpeg4video.o \
OBJS-$(CONFIG_H264_DECODER) += h264.o h264_cabac.o h264_cavlc.o \
h264_direct.o h264_loopfilter.o \
h264_mb.o h264_picture.o h264_ps.o \
- h264_refs.o h264_sei.o h264_slice.o
+ h264_refs.o h264_sei.o h264_slice.o h264data.o
OBJS-$(CONFIG_H264_MEDIACODEC_DECODER) += mediacodecdec_h264.o
OBJS-$(CONFIG_H264_MMAL_DECODER) += mmaldec.o
OBJS-$(CONFIG_H264_VDA_DECODER) += vda_h264_dec.o
diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c
index 23cc9b1..b1abb9a 100644
--- a/libavcodec/dxva2_h264.c
+++ b/libavcodec/dxva2_h264.c
@@ -178,7 +178,7 @@ static void fill_scaling_lists(const AVCodecContext *avctx, AVDXVAContext *ctx,
} else {
for (i = 0; i < 6; i++)
for (j = 0; j < 16; j++)
- qm->bScalingLists4x4[i][j] = h->pps.scaling_matrix4[i][zigzag_scan[j]];
+ qm->bScalingLists4x4[i][j] = h->pps.scaling_matrix4[i][ff_zigzag_scan[j]];
for (i = 0; i < 64; i++) {
qm->bScalingLists8x8[0][i] = h->pps.scaling_matrix8[0][ff_zigzag_direct[i]];
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index deab35a..cb98eb5 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -1992,8 +1992,8 @@ int ff_h264_decode_mb_cabac(const H264Context *h, H264SliceContext *sl)
mb_type= bits - 4; /* B_L0_Bi_* through B_Bi_Bi_* */
}
}
- partition_count= b_mb_type_info[mb_type].partition_count;
- mb_type= b_mb_type_info[mb_type].type;
+ partition_count = ff_h264_b_mb_type_info[mb_type].partition_count;
+ mb_type = ff_h264_b_mb_type_info[mb_type].type;
} else if (sl->slice_type_nos == AV_PICTURE_TYPE_P) {
if( get_cabac_noinline( &sl->cabac, &sl->cabac_state[14] ) == 0 ) {
/* P-type */
@@ -2004,8 +2004,8 @@ int ff_h264_decode_mb_cabac(const H264Context *h, H264SliceContext *sl)
/* P_L0_D8x16, P_L0_D16x8 */
mb_type= 2 - get_cabac_noinline( &sl->cabac, &sl->cabac_state[17] );
}
- partition_count= p_mb_type_info[mb_type].partition_count;
- mb_type= p_mb_type_info[mb_type].type;
+ partition_count = ff_h264_p_mb_type_info[mb_type].partition_count;
+ mb_type = ff_h264_p_mb_type_info[mb_type].type;
} else {
mb_type = decode_cabac_intra_mb_type(sl, 17, 0);
goto decode_intra_mb;
@@ -2017,9 +2017,9 @@ int ff_h264_decode_mb_cabac(const H264Context *h, H264SliceContext *sl)
av_assert2(sl->slice_type_nos == AV_PICTURE_TYPE_I);
decode_intra_mb:
partition_count = 0;
- cbp= i_mb_type_info[mb_type].cbp;
- sl->intra16x16_pred_mode = i_mb_type_info[mb_type].pred_mode;
- mb_type= i_mb_type_info[mb_type].type;
+ cbp = ff_h264_i_mb_type_info[mb_type].cbp;
+ sl->intra16x16_pred_mode = ff_h264_i_mb_type_info[mb_type].pred_mode;
+ mb_type = ff_h264_i_mb_type_info[mb_type].type;
}
if (MB_FIELD(sl))
mb_type |= MB_TYPE_INTERLACED;
@@ -2106,8 +2106,8 @@ decode_intra_mb:
if (sl->slice_type_nos == AV_PICTURE_TYPE_B ) {
for( i = 0; i < 4; i++ ) {
sl->sub_mb_type[i] = decode_cabac_b_mb_sub_type(sl);
- sub_partition_count[i] = b_sub_mb_type_info[sl->sub_mb_type[i]].partition_count;
- sl->sub_mb_type[i] = b_sub_mb_type_info[sl->sub_mb_type[i]].type;
+ sub_partition_count[i] = ff_h264_b_sub_mb_type_info[sl->sub_mb_type[i]].partition_count;
+ sl->sub_mb_type[i] = ff_h264_b_sub_mb_type_info[sl->sub_mb_type[i]].type;
}
if (IS_DIRECT(sl->sub_mb_type[0] | sl->sub_mb_type[1] |
sl->sub_mb_type[2] | sl->sub_mb_type[3])) {
@@ -2122,8 +2122,8 @@ decode_intra_mb:
} else {
for( i = 0; i < 4; i++ ) {
sl->sub_mb_type[i] = decode_cabac_p_mb_sub_type(sl);
- sub_partition_count[i] = p_sub_mb_type_info[sl->sub_mb_type[i]].partition_count;
- sl->sub_mb_type[i] = p_sub_mb_type_info[sl->sub_mb_type[i]].type;
+ sub_partition_count[i] = ff_h264_p_sub_mb_type_info[sl->sub_mb_type[i]].partition_count;
+ sl->sub_mb_type[i] = ff_h264_p_sub_mb_type_info[sl->sub_mb_type[i]].type;
}
}
@@ -2414,7 +2414,7 @@ decode_intra_mb:
for (c = 0; c < 2; c++)
decode_cabac_residual_dc_422(h, sl, sl->mb + ((256 + 16*16*c) << pixel_shift), 3,
CHROMA_DC_BLOCK_INDEX + c,
- chroma422_dc_scan, 8);
+ ff_h264_chroma422_dc_scan, 8);
}
if( cbp&0x20 ) {
@@ -2438,7 +2438,8 @@ decode_intra_mb:
if( cbp&0x30 ){
int c;
for (c = 0; c < 2; c++)
- decode_cabac_residual_dc(h, sl, sl->mb + ((256 + 16*16*c) << pixel_shift), 3, CHROMA_DC_BLOCK_INDEX+c, chroma_dc_scan, 4);
+ decode_cabac_residual_dc(h, sl, sl->mb + ((256 + 16 * 16 * c) << pixel_shift),
+ 3, CHROMA_DC_BLOCK_INDEX + c, ff_h264_chroma_dc_scan, 4);
}
if( cbp&0x20 ) {
diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c
index 5998d93..2996cfd 100644
--- a/libavcodec/h264_cavlc.c
+++ b/libavcodec/h264_cavlc.c
@@ -31,8 +31,8 @@
#include "internal.h"
#include "avcodec.h"
#include "h264.h"
-#include "h264data.h" // FIXME FIXME FIXME
#include "h264_mvpred.h"
+#include "h264data.h"
#include "golomb.h"
#include "mpegutils.h"
#include "libavutil/avassert.h"
@@ -740,16 +740,16 @@ int ff_h264_decode_mb_cavlc(const H264Context *h, H264SliceContext *sl)
mb_type= get_ue_golomb(&sl->gb);
if (sl->slice_type_nos == AV_PICTURE_TYPE_B) {
if(mb_type < 23){
- partition_count= b_mb_type_info[mb_type].partition_count;
- mb_type= b_mb_type_info[mb_type].type;
+ partition_count = ff_h264_b_mb_type_info[mb_type].partition_count;
+ mb_type = ff_h264_b_mb_type_info[mb_type].type;
}else{
mb_type -= 23;
goto decode_intra_mb;
}
} else if (sl->slice_type_nos == AV_PICTURE_TYPE_P) {
if(mb_type < 5){
- partition_count= p_mb_type_info[mb_type].partition_count;
- mb_type= p_mb_type_info[mb_type].type;
+ partition_count = ff_h264_p_mb_type_info[mb_type].partition_count;
+ mb_type = ff_h264_p_mb_type_info[mb_type].type;
}else{
mb_type -= 5;
goto decode_intra_mb;
@@ -764,9 +764,9 @@ decode_intra_mb:
return -1;
}
partition_count=0;
- cbp= i_mb_type_info[mb_type].cbp;
- sl->intra16x16_pred_mode = i_mb_type_info[mb_type].pred_mode;
- mb_type= i_mb_type_info[mb_type].type;
+ cbp = ff_h264_i_mb_type_info[mb_type].cbp;
+ sl->intra16x16_pred_mode = ff_h264_i_mb_type_info[mb_type].pred_mode;
+ mb_type = ff_h264_i_mb_type_info[mb_type].type;
}
if (MB_FIELD(sl))
@@ -850,8 +850,8 @@ decode_intra_mb:
av_log(h->avctx, AV_LOG_ERROR, "B sub_mb_type %u out of range at %d %d\n", sl->sub_mb_type[i], sl->mb_x, sl->mb_y);
return -1;
}
- sub_partition_count[i]= b_sub_mb_type_info[ sl->sub_mb_type[i] ].partition_count;
- sl->sub_mb_type[i]= b_sub_mb_type_info[ sl->sub_mb_type[i] ].type;
+ sub_partition_count[i] = ff_h264_b_sub_mb_type_info[sl->sub_mb_type[i]].partition_count;
+ sl->sub_mb_type[i] = ff_h264_b_sub_mb_type_info[sl->sub_mb_type[i]].type;
}
if( IS_DIRECT(sl->sub_mb_type[0]|sl->sub_mb_type[1]|sl->sub_mb_type[2]|sl->sub_mb_type[3])) {
ff_h264_pred_direct_motion(h, sl, &mb_type);
@@ -868,8 +868,8 @@ decode_intra_mb:
av_log(h->avctx, AV_LOG_ERROR, "P sub_mb_type %u out of range at %d %d\n", sl->sub_mb_type[i], sl->mb_x, sl->mb_y);
return -1;
}
- sub_partition_count[i]= p_sub_mb_type_info[ sl->sub_mb_type[i] ].partition_count;
- sl->sub_mb_type[i]= p_sub_mb_type_info[ sl->sub_mb_type[i] ].type;
+ sub_partition_count[i] = ff_h264_p_sub_mb_type_info[sl->sub_mb_type[i]].partition_count;
+ sl->sub_mb_type[i] = ff_h264_p_sub_mb_type_info[sl->sub_mb_type[i]].type;
}
}
@@ -1069,8 +1069,10 @@ decode_intra_mb:
av_log(h->avctx, AV_LOG_ERROR, "cbp too large (%u) at %d %d\n", cbp, sl->mb_x, sl->mb_y);
return -1;
}
- if(IS_INTRA4x4(mb_type)) cbp= golomb_to_intra4x4_cbp[cbp];
- else cbp= golomb_to_inter_cbp [cbp];
+ if (IS_INTRA4x4(mb_type))
+ cbp = ff_h264_golomb_to_intra4x4_cbp[cbp];
+ else
+ cbp = ff_h264_golomb_to_inter_cbp[cbp];
}else{
if(cbp > 15){
av_log(h->avctx, AV_LOG_ERROR, "cbp too large (%u) at %d %d\n", cbp, sl->mb_x, sl->mb_y);
@@ -1142,9 +1144,9 @@ decode_intra_mb:
if(cbp&0x30){
for(chroma_idx=0; chroma_idx<2; chroma_idx++)
if (decode_residual(h, sl, gb, sl->mb + ((256 + 16*16*chroma_idx) << pixel_shift),
- CHROMA_DC_BLOCK_INDEX+chroma_idx,
- CHROMA422(h) ? chroma422_dc_scan : chroma_dc_scan,
- NULL, 4*num_c8x8) < 0) {
+ CHROMA_DC_BLOCK_INDEX + chroma_idx,
+ CHROMA422(h) ? ff_h264_chroma422_dc_scan : ff_h264_chroma_dc_scan,
+ NULL, 4 * num_c8x8) < 0) {
return -1;
}
}
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index cbf5b3a..9a06d61 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -312,7 +312,7 @@ static inline int parse_nal_units(AVCodecParserContext *s,
init_get_bits(&sl->gb, ptr, 8 * dst_length);
get_ue_golomb_long(&sl->gb); // skip first_mb_in_slice
slice_type = get_ue_golomb_31(&sl->gb);
- s->pict_type = golomb_to_pict_type[slice_type % 5];
+ s->pict_type = ff_h264_golomb_to_pict_type[slice_type % 5];
if (h->sei_recovery_frame_cnt >= 0) {
/* key frame, since recovery_frame_cnt is set */
s->key_frame = 1;
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index af52cf6..f0f0a50 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1228,7 +1228,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
} else
sl->slice_type_fixed = 0;
- slice_type = golomb_to_pict_type[slice_type];
+ slice_type = ff_h264_golomb_to_pict_type[slice_type];
sl->slice_type = slice_type;
sl->slice_type_nos = slice_type & 3;
diff --git a/libavcodec/h264data.c b/libavcodec/h264data.c
new file mode 100644
index 0000000..35b0a07
--- /dev/null
+++ b/libavcodec/h264data.c
@@ -0,0 +1,149 @@
+/*
+ * H26L/H264/AVC/JVT/14496-10/... encoder/decoder
+ * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of FFmpeg.
+ *
+ * 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.
+ *
+ * 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
+ */
+
+/**
+ * @file
+ * @brief
+ * H264 / AVC / MPEG4 part10 codec data table
+ * @author Michael Niedermayer <michaelni at gmx.at>
+ */
+
+#include <stdint.h>
+
+#include "libavutil/avutil.h"
+
+#include "avcodec.h"
+#include "h264data.h"
+
+const uint8_t ff_h264_golomb_to_pict_type[5] = {
+ AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, AV_PICTURE_TYPE_I,
+ AV_PICTURE_TYPE_SP, AV_PICTURE_TYPE_SI
+};
+
+const uint8_t ff_h264_golomb_to_intra4x4_cbp[48] = {
+ 47, 31, 15, 0, 23, 27, 29, 30, 7, 11, 13, 14, 39, 43, 45, 46,
+ 16, 3, 5, 10, 12, 19, 21, 26, 28, 35, 37, 42, 44, 1, 2, 4,
+ 8, 17, 18, 20, 24, 6, 9, 22, 25, 32, 33, 34, 36, 40, 38, 41
+};
+
+const uint8_t ff_h264_golomb_to_inter_cbp[48] = {
+ 0, 16, 1, 2, 4, 8, 32, 3, 5, 10, 12, 15, 47, 7, 11, 13,
+ 14, 6, 9, 31, 35, 37, 42, 44, 33, 34, 36, 40, 39, 43, 45, 46,
+ 17, 18, 20, 24, 19, 21, 26, 28, 23, 27, 29, 30, 22, 25, 38, 41
+};
+
+const uint8_t ff_h264_chroma_dc_scan[4] = {
+ (0 + 0 * 2) * 16, (1 + 0 * 2) * 16,
+ (0 + 1 * 2) * 16, (1 + 1 * 2) * 16,
+};
+
+const uint8_t ff_h264_chroma422_dc_scan[8] = {
+ (0 + 0 * 2) * 16, (0 + 1 * 2) * 16,
+ (1 + 0 * 2) * 16, (0 + 2 * 2) * 16,
+ (0 + 3 * 2) * 16, (1 + 1 * 2) * 16,
+ (1 + 2 * 2) * 16, (1 + 3 * 2) * 16,
+};
+
+const IMbInfo ff_h264_i_mb_type_info[26] = {
+ { MB_TYPE_INTRA4x4, -1, -1 },
+ { MB_TYPE_INTRA16x16, 2, 0 },
+ { MB_TYPE_INTRA16x16, 1, 0 },
+ { MB_TYPE_INTRA16x16, 0, 0 },
+ { MB_TYPE_INTRA16x16, 3, 0 },
+ { MB_TYPE_INTRA16x16, 2, 16 },
+ { MB_TYPE_INTRA16x16, 1, 16 },
+ { MB_TYPE_INTRA16x16, 0, 16 },
+ { MB_TYPE_INTRA16x16, 3, 16 },
+ { MB_TYPE_INTRA16x16, 2, 32 },
+ { MB_TYPE_INTRA16x16, 1, 32 },
+ { MB_TYPE_INTRA16x16, 0, 32 },
+ { MB_TYPE_INTRA16x16, 3, 32 },
+ { MB_TYPE_INTRA16x16, 2, 15 + 0 },
+ { MB_TYPE_INTRA16x16, 1, 15 + 0 },
+ { MB_TYPE_INTRA16x16, 0, 15 + 0 },
+ { MB_TYPE_INTRA16x16, 3, 15 + 0 },
+ { MB_TYPE_INTRA16x16, 2, 15 + 16 },
+ { MB_TYPE_INTRA16x16, 1, 15 + 16 },
+ { MB_TYPE_INTRA16x16, 0, 15 + 16 },
+ { MB_TYPE_INTRA16x16, 3, 15 + 16 },
+ { MB_TYPE_INTRA16x16, 2, 15 + 32 },
+ { MB_TYPE_INTRA16x16, 1, 15 + 32 },
+ { MB_TYPE_INTRA16x16, 0, 15 + 32 },
+ { MB_TYPE_INTRA16x16, 3, 15 + 32 },
+ { MB_TYPE_INTRA_PCM, -1, -1 },
+};
+
+const PMbInfo ff_h264_p_mb_type_info[5] = {
+ { MB_TYPE_16x16 | MB_TYPE_P0L0, 1 },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2 },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2 },
+ { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 4 },
+ { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_REF0, 4 },
+};
+
+const PMbInfo ff_h264_p_sub_mb_type_info[4] = {
+ { MB_TYPE_16x16 | MB_TYPE_P0L0, 1 },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0, 2 },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0, 2 },
+ { MB_TYPE_8x8 | MB_TYPE_P0L0, 4 },
+};
+
+const PMbInfo ff_h264_b_mb_type_info[23] = {
+ { MB_TYPE_DIRECT2 | MB_TYPE_L0L1, 1, },
+ { MB_TYPE_16x16 | MB_TYPE_P0L0, 1, },
+ { MB_TYPE_16x16 | MB_TYPE_P0L1, 1, },
+ { MB_TYPE_16x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1, 1, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L1 | MB_TYPE_P1L0, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L1 | MB_TYPE_P1L0, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 4, },
+};
+
+const PMbInfo ff_h264_b_sub_mb_type_info[13] = {
+ { MB_TYPE_DIRECT2, 1, },
+ { MB_TYPE_16x16 | MB_TYPE_P0L0, 1, },
+ { MB_TYPE_16x16 | MB_TYPE_P0L1, 1, },
+ { MB_TYPE_16x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1, 1, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 4, },
+ { MB_TYPE_8x8 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 4, },
+ { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 4, },
+};
diff --git a/libavcodec/h264data.h b/libavcodec/h264data.h
index a6c69e5..fb67360 100644
--- a/libavcodec/h264data.h
+++ b/libavcodec/h264data.h
@@ -1,7 +1,4 @@
/*
- * H26L/H264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
@@ -19,49 +16,19 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-/**
- * @file
- * @brief
- * H264 / AVC / MPEG4 part10 codec data table
- * @author Michael Niedermayer <michaelni at gmx.at>
- */
-
#ifndef AVCODEC_H264DATA_H
#define AVCODEC_H264DATA_H
#include <stdint.h>
-#include "libavutil/rational.h"
#include "h264.h"
-static const uint8_t golomb_to_pict_type[5] = {
- AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, AV_PICTURE_TYPE_I,
- AV_PICTURE_TYPE_SP, AV_PICTURE_TYPE_SI
-};
-
-static const uint8_t golomb_to_intra4x4_cbp[48] = {
- 47, 31, 15, 0, 23, 27, 29, 30, 7, 11, 13, 14, 39, 43, 45, 46,
- 16, 3, 5, 10, 12, 19, 21, 26, 28, 35, 37, 42, 44, 1, 2, 4,
- 8, 17, 18, 20, 24, 6, 9, 22, 25, 32, 33, 34, 36, 40, 38, 41
-};
+extern const uint8_t ff_h264_golomb_to_pict_type[5];
+extern const uint8_t ff_h264_golomb_to_intra4x4_cbp[48];
+extern const uint8_t ff_h264_golomb_to_inter_cbp[48];
-static const uint8_t golomb_to_inter_cbp[48] = {
- 0, 16, 1, 2, 4, 8, 32, 3, 5, 10, 12, 15, 47, 7, 11, 13,
- 14, 6, 9, 31, 35, 37, 42, 44, 33, 34, 36, 40, 39, 43, 45, 46,
- 17, 18, 20, 24, 19, 21, 26, 28, 23, 27, 29, 30, 22, 25, 38, 41
-};
-
-static const uint8_t chroma_dc_scan[4] = {
- (0 + 0 * 2) * 16, (1 + 0 * 2) * 16,
- (0 + 1 * 2) * 16, (1 + 1 * 2) * 16,
-};
-
-static const uint8_t chroma422_dc_scan[8] = {
- (0 + 0 * 2) * 16, (0 + 1 * 2) * 16,
- (1 + 0 * 2) * 16, (0 + 2 * 2) * 16,
- (0 + 3 * 2) * 16, (1 + 1 * 2) * 16,
- (1 + 2 * 2) * 16, (1 + 3 * 2) * 16,
-};
+extern const uint8_t ff_h264_chroma_dc_scan[4];
+extern const uint8_t ff_h264_chroma422_dc_scan[8];
typedef struct IMbInfo {
uint16_t type;
@@ -69,96 +36,17 @@ typedef struct IMbInfo {
uint8_t cbp;
} IMbInfo;
-static const IMbInfo i_mb_type_info[26] = {
- { MB_TYPE_INTRA4x4, -1, -1 },
- { MB_TYPE_INTRA16x16, 2, 0 },
- { MB_TYPE_INTRA16x16, 1, 0 },
- { MB_TYPE_INTRA16x16, 0, 0 },
- { MB_TYPE_INTRA16x16, 3, 0 },
- { MB_TYPE_INTRA16x16, 2, 16 },
- { MB_TYPE_INTRA16x16, 1, 16 },
- { MB_TYPE_INTRA16x16, 0, 16 },
- { MB_TYPE_INTRA16x16, 3, 16 },
- { MB_TYPE_INTRA16x16, 2, 32 },
- { MB_TYPE_INTRA16x16, 1, 32 },
- { MB_TYPE_INTRA16x16, 0, 32 },
- { MB_TYPE_INTRA16x16, 3, 32 },
- { MB_TYPE_INTRA16x16, 2, 15 + 0 },
- { MB_TYPE_INTRA16x16, 1, 15 + 0 },
- { MB_TYPE_INTRA16x16, 0, 15 + 0 },
- { MB_TYPE_INTRA16x16, 3, 15 + 0 },
- { MB_TYPE_INTRA16x16, 2, 15 + 16 },
- { MB_TYPE_INTRA16x16, 1, 15 + 16 },
- { MB_TYPE_INTRA16x16, 0, 15 + 16 },
- { MB_TYPE_INTRA16x16, 3, 15 + 16 },
- { MB_TYPE_INTRA16x16, 2, 15 + 32 },
- { MB_TYPE_INTRA16x16, 1, 15 + 32 },
- { MB_TYPE_INTRA16x16, 0, 15 + 32 },
- { MB_TYPE_INTRA16x16, 3, 15 + 32 },
- { MB_TYPE_INTRA_PCM, -1, -1 },
-};
+extern const IMbInfo ff_h264_i_mb_type_info[26];
typedef struct PMbInfo {
uint16_t type;
uint8_t partition_count;
} PMbInfo;
-static const PMbInfo p_mb_type_info[5] = {
- { MB_TYPE_16x16 | MB_TYPE_P0L0, 1 },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2 },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2 },
- { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 4 },
- { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_REF0, 4 },
-};
-
-static const PMbInfo p_sub_mb_type_info[4] = {
- { MB_TYPE_16x16 | MB_TYPE_P0L0, 1 },
- { MB_TYPE_16x8 | MB_TYPE_P0L0, 2 },
- { MB_TYPE_8x16 | MB_TYPE_P0L0, 2 },
- { MB_TYPE_8x8 | MB_TYPE_P0L0, 4 },
-};
-
-static const PMbInfo b_mb_type_info[23] = {
- { MB_TYPE_DIRECT2 | MB_TYPE_L0L1, 1, },
- { MB_TYPE_16x16 | MB_TYPE_P0L0, 1, },
- { MB_TYPE_16x16 | MB_TYPE_P0L1, 1, },
- { MB_TYPE_16x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1, 1, },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L1 | MB_TYPE_P1L0, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L1 | MB_TYPE_P1L0, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 4, },
-};
-
-static const PMbInfo b_sub_mb_type_info[13] = {
- { MB_TYPE_DIRECT2, 1, },
- { MB_TYPE_16x16 | MB_TYPE_P0L0, 1, },
- { MB_TYPE_16x16 | MB_TYPE_P0L1, 1, },
- { MB_TYPE_16x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1, 1, },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 4, },
- { MB_TYPE_8x8 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 4, },
- { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 4, },
-};
+extern const PMbInfo ff_h264_p_mb_type_info[5];
+extern const PMbInfo ff_h264_p_sub_mb_type_info[4];
+extern const PMbInfo ff_h264_b_mb_type_info[23];
+extern const PMbInfo ff_h264_b_sub_mb_type_info[13];
static const AVRational ff_h264_pixel_aspect[17] = {
{ 0, 1 },
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 5e5bcb3..fda8300 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -47,10 +47,8 @@
#include "avcodec.h"
#include "mpegutils.h"
#include "h264.h"
-
-#include "h264data.h" // FIXME FIXME FIXME
-
#include "h264_mvpred.h"
+#include "h264data.h"
#include "golomb.h"
#include "hpeldsp.h"
#include "mathops.h"
@@ -246,7 +244,7 @@ static inline int svq3_decode_block(GetBitContext *gb, int16_t *block,
int index, const int type)
{
static const uint8_t *const scan_patterns[4] = {
- luma_dc_zigzag_scan, ff_zigzag_scan, svq3_scan, chroma_dc_scan
+ luma_dc_zigzag_scan, ff_zigzag_scan, svq3_scan, ff_h264_chroma_dc_scan
};
int run, level, sign, limit;
@@ -670,7 +668,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
mb_type = MB_TYPE_INTRA4x4;
} else { /* INTRA16x16 */
- dir = i_mb_type_info[mb_type - 8].pred_mode;
+ dir = ff_h264_i_mb_type_info[mb_type - 8].pred_mode;
dir = (dir >> 1) ^ 3 * (dir & 1) ^ 1;
if ((sl->intra16x16_pred_mode = ff_h264_check_intra_pred_mode(h, sl, dir, 0)) < 0) {
@@ -678,7 +676,7 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
return sl->intra16x16_pred_mode;
}
- cbp = i_mb_type_info[mb_type - 8].cbp;
+ cbp = ff_h264_i_mb_type_info[mb_type - 8].cbp;
mb_type = MB_TYPE_INTRA16x16;
}
@@ -706,8 +704,8 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
return -1;
}
- cbp = IS_INTRA(mb_type) ? golomb_to_intra4x4_cbp[vlc]
- : golomb_to_inter_cbp[vlc];
+ cbp = IS_INTRA(mb_type) ? ff_h264_golomb_to_intra4x4_cbp[vlc]
+ : ff_h264_golomb_to_inter_cbp[vlc];
}
if (IS_INTRA16x16(mb_type) ||
(h->pict_type != AV_PICTURE_TYPE_I && s->adaptive_quant && cbp)) {
@@ -835,7 +833,7 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
return -1;
}
- sl->slice_type = golomb_to_pict_type[slice_id];
+ sl->slice_type = ff_h264_golomb_to_pict_type[slice_id];
if ((header & 0x9F) == 2) {
i = (h->mb_num < 64) ? 6 : (1 + av_log2(h->mb_num - 1));
======================================================================
diff --cc libavcodec/Makefile
index bc4c97f,f484180..679f2f2
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@@ -308,10 -251,10 +308,10 @@@ OBJS-$(CONFIG_H263_ENCODER)
OBJS-$(CONFIG_H264_DECODER) += h264.o h264_cabac.o h264_cavlc.o \
h264_direct.o h264_loopfilter.o \
h264_mb.o h264_picture.o h264_ps.o \
- h264_refs.o h264_sei.o h264_slice.o
- h264_refs.o h264_sei.o \
- h264_slice.o h264data.o
++ h264_refs.o h264_sei.o h264_slice.o h264data.o
+OBJS-$(CONFIG_H264_MEDIACODEC_DECODER) += mediacodecdec_h264.o
OBJS-$(CONFIG_H264_MMAL_DECODER) += mmaldec.o
-OBJS-$(CONFIG_H264_NVENC_ENCODER) += nvenc_h264.o
+OBJS-$(CONFIG_H264_VDA_DECODER) += vda_h264_dec.o
OBJS-$(CONFIG_H264_QSV_DECODER) += qsvdec_h2645.o
OBJS-$(CONFIG_H264_QSV_ENCODER) += qsvenc_h264.o
OBJS-$(CONFIG_HAP_DECODER) += hapdec.o hap.o
diff --cc libavcodec/h264_cabac.c
index deab35a,37f98dd..cb98eb5
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@@ -2014,12 -2008,12 +2014,12 @@@ int ff_h264_decode_mb_cabac(const H264C
mb_type = decode_cabac_intra_mb_type(sl, 3, 1);
if (sl->slice_type == AV_PICTURE_TYPE_SI && mb_type)
mb_type--;
- assert(sl->slice_type_nos == AV_PICTURE_TYPE_I);
+ av_assert2(sl->slice_type_nos == AV_PICTURE_TYPE_I);
decode_intra_mb:
partition_count = 0;
- cbp= i_mb_type_info[mb_type].cbp;
- sl->intra16x16_pred_mode = i_mb_type_info[mb_type].pred_mode;
- mb_type= i_mb_type_info[mb_type].type;
+ cbp = ff_h264_i_mb_type_info[mb_type].cbp;
+ sl->intra16x16_pred_mode = ff_h264_i_mb_type_info[mb_type].pred_mode;
+ mb_type = ff_h264_i_mb_type_info[mb_type].type;
}
if (MB_FIELD(sl))
mb_type |= MB_TYPE_INTERLACED;
diff --cc libavcodec/h264_cavlc.c
index 5998d93,45a8386..2996cfd
--- a/libavcodec/h264_cavlc.c
+++ b/libavcodec/h264_cavlc.c
@@@ -31,12 -30,12 +31,12 @@@
#include "internal.h"
#include "avcodec.h"
#include "h264.h"
- #include "h264data.h" // FIXME FIXME FIXME
#include "h264_mvpred.h"
+ #include "h264data.h"
#include "golomb.h"
#include "mpegutils.h"
+#include "libavutil/avassert.h"
-#include <assert.h>
static const uint8_t golomb_to_inter_cbp_gray[16]={
0, 1, 2, 4, 8, 3, 5,10,12,15, 7,11,13,14, 6, 9,
@@@ -1142,9 -1130,8 +1144,9 @@@ decode_intra_mb
if(cbp&0x30){
for(chroma_idx=0; chroma_idx<2; chroma_idx++)
if (decode_residual(h, sl, gb, sl->mb + ((256 + 16*16*chroma_idx) << pixel_shift),
- CHROMA_DC_BLOCK_INDEX+chroma_idx,
- CHROMA422(h) ? chroma422_dc_scan : chroma_dc_scan,
- NULL, 4*num_c8x8) < 0) {
- CHROMA_DC_BLOCK_INDEX + chroma_idx, ff_h264_chroma422_dc_scan,
- NULL, 8) < 0) {
++ CHROMA_DC_BLOCK_INDEX + chroma_idx,
++ CHROMA422(h) ? ff_h264_chroma422_dc_scan : ff_h264_chroma_dc_scan,
++ NULL, 4 * num_c8x8) < 0) {
return -1;
}
}
diff --cc libavcodec/h264_parser.c
index cbf5b3a,0f970ae..9a06d61
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@@ -310,9 -259,9 +310,9 @@@ static inline int parse_nal_units(AVCod
/* fall through */
case NAL_SLICE:
init_get_bits(&sl->gb, ptr, 8 * dst_length);
- get_ue_golomb(&sl->gb); // skip first_mb_in_slice
+ get_ue_golomb_long(&sl->gb); // skip first_mb_in_slice
slice_type = get_ue_golomb_31(&sl->gb);
- s->pict_type = golomb_to_pict_type[slice_type % 5];
+ s->pict_type = ff_h264_golomb_to_pict_type[slice_type % 5];
if (h->sei_recovery_frame_cnt >= 0) {
/* key frame, since recovery_frame_cnt is set */
s->key_frame = 1;
diff --cc libavcodec/h264data.c
index 0000000,f7aed48..35b0a07
mode 000000,100644..100644
--- a/libavcodec/h264data.c
+++ b/libavcodec/h264data.c
@@@ -1,0 -1,149 +1,149 @@@
+ /*
+ * H26L/H264/AVC/JVT/14496-10/... encoder/decoder
+ * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
+ *
- * This file is part of Libav.
++ * This file is part of FFmpeg.
+ *
- * Libav is free software; you can redistribute it and/or
++ * 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.
+ *
- * Libav is distributed in the hope that it will be useful,
++ * 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 Libav; if not, write to the Free Software
++ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+ /**
+ * @file
+ * @brief
+ * H264 / AVC / MPEG4 part10 codec data table
+ * @author Michael Niedermayer <michaelni at gmx.at>
+ */
+
+ #include <stdint.h>
+
+ #include "libavutil/avutil.h"
+
+ #include "avcodec.h"
+ #include "h264data.h"
+
+ const uint8_t ff_h264_golomb_to_pict_type[5] = {
+ AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, AV_PICTURE_TYPE_I,
+ AV_PICTURE_TYPE_SP, AV_PICTURE_TYPE_SI
+ };
+
+ const uint8_t ff_h264_golomb_to_intra4x4_cbp[48] = {
+ 47, 31, 15, 0, 23, 27, 29, 30, 7, 11, 13, 14, 39, 43, 45, 46,
+ 16, 3, 5, 10, 12, 19, 21, 26, 28, 35, 37, 42, 44, 1, 2, 4,
+ 8, 17, 18, 20, 24, 6, 9, 22, 25, 32, 33, 34, 36, 40, 38, 41
+ };
+
+ const uint8_t ff_h264_golomb_to_inter_cbp[48] = {
+ 0, 16, 1, 2, 4, 8, 32, 3, 5, 10, 12, 15, 47, 7, 11, 13,
+ 14, 6, 9, 31, 35, 37, 42, 44, 33, 34, 36, 40, 39, 43, 45, 46,
+ 17, 18, 20, 24, 19, 21, 26, 28, 23, 27, 29, 30, 22, 25, 38, 41
+ };
+
+ const uint8_t ff_h264_chroma_dc_scan[4] = {
+ (0 + 0 * 2) * 16, (1 + 0 * 2) * 16,
+ (0 + 1 * 2) * 16, (1 + 1 * 2) * 16,
+ };
+
+ const uint8_t ff_h264_chroma422_dc_scan[8] = {
+ (0 + 0 * 2) * 16, (0 + 1 * 2) * 16,
+ (1 + 0 * 2) * 16, (0 + 2 * 2) * 16,
+ (0 + 3 * 2) * 16, (1 + 1 * 2) * 16,
+ (1 + 2 * 2) * 16, (1 + 3 * 2) * 16,
+ };
+
+ const IMbInfo ff_h264_i_mb_type_info[26] = {
+ { MB_TYPE_INTRA4x4, -1, -1 },
+ { MB_TYPE_INTRA16x16, 2, 0 },
+ { MB_TYPE_INTRA16x16, 1, 0 },
+ { MB_TYPE_INTRA16x16, 0, 0 },
+ { MB_TYPE_INTRA16x16, 3, 0 },
+ { MB_TYPE_INTRA16x16, 2, 16 },
+ { MB_TYPE_INTRA16x16, 1, 16 },
+ { MB_TYPE_INTRA16x16, 0, 16 },
+ { MB_TYPE_INTRA16x16, 3, 16 },
+ { MB_TYPE_INTRA16x16, 2, 32 },
+ { MB_TYPE_INTRA16x16, 1, 32 },
+ { MB_TYPE_INTRA16x16, 0, 32 },
+ { MB_TYPE_INTRA16x16, 3, 32 },
+ { MB_TYPE_INTRA16x16, 2, 15 + 0 },
+ { MB_TYPE_INTRA16x16, 1, 15 + 0 },
+ { MB_TYPE_INTRA16x16, 0, 15 + 0 },
+ { MB_TYPE_INTRA16x16, 3, 15 + 0 },
+ { MB_TYPE_INTRA16x16, 2, 15 + 16 },
+ { MB_TYPE_INTRA16x16, 1, 15 + 16 },
+ { MB_TYPE_INTRA16x16, 0, 15 + 16 },
+ { MB_TYPE_INTRA16x16, 3, 15 + 16 },
+ { MB_TYPE_INTRA16x16, 2, 15 + 32 },
+ { MB_TYPE_INTRA16x16, 1, 15 + 32 },
+ { MB_TYPE_INTRA16x16, 0, 15 + 32 },
+ { MB_TYPE_INTRA16x16, 3, 15 + 32 },
+ { MB_TYPE_INTRA_PCM, -1, -1 },
+ };
+
+ const PMbInfo ff_h264_p_mb_type_info[5] = {
+ { MB_TYPE_16x16 | MB_TYPE_P0L0, 1 },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2 },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2 },
+ { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 4 },
+ { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_REF0, 4 },
+ };
+
+ const PMbInfo ff_h264_p_sub_mb_type_info[4] = {
+ { MB_TYPE_16x16 | MB_TYPE_P0L0, 1 },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0, 2 },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0, 2 },
+ { MB_TYPE_8x8 | MB_TYPE_P0L0, 4 },
+ };
+
+ const PMbInfo ff_h264_b_mb_type_info[23] = {
+ { MB_TYPE_DIRECT2 | MB_TYPE_L0L1, 1, },
+ { MB_TYPE_16x16 | MB_TYPE_P0L0, 1, },
+ { MB_TYPE_16x16 | MB_TYPE_P0L1, 1, },
+ { MB_TYPE_16x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1, 1, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L1 | MB_TYPE_P1L0, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L1 | MB_TYPE_P1L0, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 4, },
+ };
+
+ const PMbInfo ff_h264_b_sub_mb_type_info[13] = {
+ { MB_TYPE_DIRECT2, 1, },
+ { MB_TYPE_16x16 | MB_TYPE_P0L0, 1, },
+ { MB_TYPE_16x16 | MB_TYPE_P0L1, 1, },
+ { MB_TYPE_16x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1, 1, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
+ { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 4, },
+ { MB_TYPE_8x8 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 4, },
+ { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 4, },
+ };
diff --cc libavcodec/h264data.h
index a6c69e5,bb3fb6a..fb67360
--- a/libavcodec/h264data.h
+++ b/libavcodec/h264data.h
@@@ -1,10 -1,7 +1,7 @@@
/*
- * H26L/H264/AVC/JVT/14496-10/... encoder/decoder
- * Copyright (c) 2003 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * 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.
@@@ -103,80 -43,9 +43,28 @@@ typedef struct PMbInfo
uint8_t partition_count;
} PMbInfo;
- static const PMbInfo p_mb_type_info[5] = {
- { MB_TYPE_16x16 | MB_TYPE_P0L0, 1 },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2 },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2 },
- { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 4 },
- { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_REF0, 4 },
- };
-
- static const PMbInfo p_sub_mb_type_info[4] = {
- { MB_TYPE_16x16 | MB_TYPE_P0L0, 1 },
- { MB_TYPE_16x8 | MB_TYPE_P0L0, 2 },
- { MB_TYPE_8x16 | MB_TYPE_P0L0, 2 },
- { MB_TYPE_8x8 | MB_TYPE_P0L0, 4 },
- };
-
- static const PMbInfo b_mb_type_info[23] = {
- { MB_TYPE_DIRECT2 | MB_TYPE_L0L1, 1, },
- { MB_TYPE_16x16 | MB_TYPE_P0L0, 1, },
- { MB_TYPE_16x16 | MB_TYPE_P0L1, 1, },
- { MB_TYPE_16x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1, 1, },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L1 | MB_TYPE_P1L0, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L1 | MB_TYPE_P1L0, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 4, },
- };
-
- static const PMbInfo b_sub_mb_type_info[13] = {
- { MB_TYPE_DIRECT2, 1, },
- { MB_TYPE_16x16 | MB_TYPE_P0L0, 1, },
- { MB_TYPE_16x16 | MB_TYPE_P0L1, 1, },
- { MB_TYPE_16x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1, 1, },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_16x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x16 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 2, },
- { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P1L0, 4, },
- { MB_TYPE_8x8 | MB_TYPE_P0L1 | MB_TYPE_P1L1, 4, },
- { MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | MB_TYPE_P1L0 | MB_TYPE_P1L1, 4, },
- };
+ extern const PMbInfo ff_h264_p_mb_type_info[5];
+ extern const PMbInfo ff_h264_p_sub_mb_type_info[4];
+ extern const PMbInfo ff_h264_b_mb_type_info[23];
+ extern const PMbInfo ff_h264_b_sub_mb_type_info[13];
+static const AVRational ff_h264_pixel_aspect[17] = {
+ { 0, 1 },
+ { 1, 1 },
+ { 12, 11 },
+ { 10, 11 },
+ { 16, 11 },
+ { 40, 33 },
+ { 24, 11 },
+ { 20, 11 },
+ { 32, 11 },
+ { 80, 33 },
+ { 18, 11 },
+ { 15, 11 },
+ { 64, 33 },
+ { 160, 99 },
+ { 4, 3 },
+ { 3, 2 },
+ { 2, 1 },
+};
#endif /* AVCODEC_H264DATA_H */
diff --cc libavcodec/svq3.c
index 5e5bcb3,b91099c..fda8300
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@@ -246,10 -239,10 +244,10 @@@ static inline int svq3_decode_block(Get
int index, const int type)
{
static const uint8_t *const scan_patterns[4] = {
- luma_dc_zigzag_scan, ff_zigzag_scan, svq3_scan, chroma_dc_scan
+ luma_dc_zigzag_scan, ff_zigzag_scan, svq3_scan, ff_h264_chroma_dc_scan
};
- int run, level, limit;
+ int run, level, sign, limit;
unsigned vlc;
const int intra = 3 * type >> 2;
const uint8_t *const scan = scan_patterns[type];
More information about the ffmpeg-cvslog
mailing list