History

Merge commit 'db7f1c7c5a1d37e7f4da64a79a97bea1c4b6e9f8'

* commit 'db7f1c7c5a1d37e7f4da64a79a97bea1c4b6e9f8': h264: Move start code search functions into separate source files. Conflicts: libavcodec/arm/Makefile libavcodec/arm/h264dsp_init_arm.c libavcodec/h264_parser.c libavcodec/h264dsp.c libavcodec/startcode.c libavcodec/startcode.h

Michael Niedermayer committed 12 years ago

Commit 77aafad2 parents de41798 db7f1c710 files · +39 −15Browse files

Unified · Split

10 files
  1. configure +2 −1
  2. libavcodec/Makefile +2 −1
  3. libavcodec/arm/Makefile +1 −1
  4. libavcodec/arm/h264dsp_init_arm.c +2 −3
  5. libavcodec/arm/startcode.h +26 −0
  6. libavcodec/h264_parser.c +1 −1
  7. libavcodec/h264dsp.c +1 −1
  8. libavcodec/h264dsp.h +1 −1
  9. libavcodec/startcode.c +3 −3
  10. libavcodec/startcode.h +0 −3
configure+2−1
@@ -1853,6 +1853,7 @@ CONFIG_EXTRA=" · 1852 unmodified lines
18531853 rtpdec
18541854 rtpenc_chain
18551855 sinewin
1856+ startcode
18561857 tpeldsp
18571858 videodsp
18581859 vp3dsp
@@ -2095,7 +2096,7 @@ h263_decoder_select="error_resilience h263_parser h263dsp mpeg_er mpegvideo qpel · 236 unmodified lines
20952096 h263_encoder_select="aandcttables h263dsp mpegvideoenc"
20962097 h263i_decoder_select="h263_decoder"
20972098 h263p_encoder_select="h263_encoder"
2098−h264_decoder_select="cabac golomb h264chroma h264dsp h264pred h264qpel videodsp"
2099+h264_decoder_select="cabac golomb h264chroma h264dsp h264pred h264qpel startcode videodsp"
20992100 h264_decoder_suggest="error_resilience"
21002101 hevc_decoder_select="bswapdsp cabac golomb videodsp"
21012102 huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp"
libavcodec/Makefile+2−1
@@ -54,7 +54,7 @@ OBJS-$(CONFIG_FFT) += avfft.o fft_fixed.o fft_float.o \ · 53 unmodified lines
5454 OBJS-$(CONFIG_GOLOMB) += golomb.o
5555 OBJS-$(CONFIG_H263DSP) += h263dsp.o
5656 OBJS-$(CONFIG_H264CHROMA) += h264chroma.o
57−OBJS-$(CONFIG_H264DSP) += h264dsp.o h264idct.o startcode.o
57+OBJS-$(CONFIG_H264DSP) += h264dsp.o h264idct.o
5858 OBJS-$(CONFIG_H264PRED) += h264pred.o
5959 OBJS-$(CONFIG_H264QPEL) += h264qpel.o
6060 OBJS-$(CONFIG_HPELDSP) += hpeldsp.o
@@ -91,6 +91,7 @@ RDFT-OBJS-$(CONFIG_HARDCODED_TABLES) += sin_tables.o · 30 unmodified lines
9191 OBJS-$(CONFIG_RDFT) += rdft.o $(RDFT-OBJS-yes)
9292 OBJS-$(CONFIG_SHARED) += log2_tab.o
9393 OBJS-$(CONFIG_SINEWIN) += sinewin.o
94+OBJS-$(CONFIG_STARTCODE) += startcode.o
9495 OBJS-$(CONFIG_TPELDSP) += tpeldsp.o
9596 OBJS-$(CONFIG_VAAPI) += vaapi.o
9697 OBJS-$(CONFIG_VDA) += vda.o
libavcodec/arm/Makefile+1−1
@@ -54,7 +54,6 @@ ARMV5TE-OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_armv5te.o \ · 53 unmodified lines
5454 ARMV5TE-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv5te.o
5555
5656 ARMV6-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_armv6.o
57−ARMV6-OBJS-$(CONFIG_H264DSP) += arm/startcode_armv6.o
5857 ARMV6-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_armv6.o \
5958 arm/hpeldsp_armv6.o
6059 ARMV6-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_armv6.o \
@@ -66,6 +65,7 @@ ARMV6-OBJS-$(CONFIG_MPEGVIDEOENC) += arm/mpegvideoencdsp_armv6.o · 5 unmodified lines
6665 ARMV6-OBJS-$(CONFIG_PIXBLOCKDSP) += arm/pixblockdsp_armv6.o
6766
6867 ARMV6-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv6.o
68+ARMV6-OBJS-$(CONFIG_STARTCODE) += arm/startcode_armv6.o
6969 ARMV6-OBJS-$(CONFIG_VC1_DECODER) += arm/startcode_armv6.o
7070 ARMV6-OBJS-$(CONFIG_VC1_PARSER) += arm/startcode_armv6.o
7171 ARMV6-OBJS-$(CONFIG_VP7_DECODER) += arm/vp8_armv6.o \
libavcodec/arm/h264dsp_init_arm.c+2−3
@@ -23,8 +23,7 @@ · 22 unmodified lines
2323 #include "libavutil/attributes.h"
2424 #include "libavutil/arm/cpu.h"
2525 #include "libavcodec/h264dsp.h"
26−
27−int ff_startcode_find_candidate_armv6(const uint8_t *buf, int size);
26+#include "libavcodec/arm/startcode.h"
2827
2928 void ff_h264_v_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha,
3029 int beta, int8_t *tc0);
@@ -109,7 +108,7 @@ av_cold void ff_h264dsp_init_arm(H264DSPContext *c, const int bit_depth, · 78 unmodified lines
109108 int cpu_flags = av_get_cpu_flags();
110109
111110 if (have_setend(cpu_flags))
112− c->h264_find_start_code_candidate = ff_startcode_find_candidate_armv6;
111+ c->startcode_find_candidate = ff_startcode_find_candidate_armv6;
113112 if (have_neon(cpu_flags))
114113 h264dsp_init_neon(c, bit_depth, chroma_format_idc);
115114 }
libavcodec/arm/startcode.h+26−0
@@ -0,0 +1,26 @@
1+/*
2+ * This file is part of FFmpeg.
3+ *
4+ * FFmpeg is free software; you can redistribute it and/or
5+ * modify it under the terms of the GNU Lesser General Public
6+ * License as published by the Free Software Foundation; either
7+ * version 2.1 of the License, or (at your option) any later version.
8+ *
9+ * FFmpeg is distributed in the hope that it will be useful,
10+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+ * Lesser General Public License for more details.
13+ *
14+ * You should have received a copy of the GNU Lesser General Public
15+ * License along with FFmpeg; if not, write to the Free Software
16+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+ */
18+
19+#ifndef AVCODEC_ARM_STARTCODE_H
20+#define AVCODEC_ARM_STARTCODE_H
21+
22+#include <stdint.h>
23+
24+int ff_startcode_find_candidate_armv6(const uint8_t *buf, int size);
25+
26+#endif /* AVCODEC_ARM_STARTCODE_H */
libavcodec/h264_parser.c+1−1
@@ -66,7 +66,7 @@ static int h264_find_frame_end(H264Context *h, const uint8_t *buf, · 65 unmodified lines
6666 }
6767
6868 if (state == 7) {
69− i += h->h264dsp.h264_find_start_code_candidate(buf + i, next_avc - i);
69+ i += h->h264dsp.startcode_find_candidate(buf + i, next_avc - i);
7070 if (i < next_avc)
7171 state = 2;
7272 } else if (state <= 2) {
libavcodec/h264dsp.c+1−1
@@ -151,7 +151,7 @@ av_cold void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, · 150 unmodified lines
151151 H264_DSP(8);
152152 break;
153153 }
154− c->h264_find_start_code_candidate = ff_startcode_find_candidate_c;
154+ c->startcode_find_candidate = ff_startcode_find_candidate_c;
155155
156156 if (ARCH_AARCH64) ff_h264dsp_init_aarch64(c, bit_depth, chroma_format_idc);
157157 if (ARCH_ARM) ff_h264dsp_init_arm(c, bit_depth, chroma_format_idc);
libavcodec/h264dsp.h+1−1
@@ -113,7 +113,7 @@ typedef struct H264DSPContext { · 112 unmodified lines
113113 * one or more further zero bytes and a one byte. Better still, filter
114114 * out any bytes that form the trailing_zero_8bits syntax element too.
115115 */
116− int (*h264_find_start_code_candidate)(const uint8_t *buf, int size);
116+ int (*startcode_find_candidate)(const uint8_t *buf, int size);
117117 } H264DSPContext;
118118
119119 void ff_h264dsp_init(H264DSPContext *c, const int bit_depth,
libavcodec/startcode.c+3−3
@@ -36,19 +36,19 @@ int ff_startcode_find_candidate_c(const uint8_t *buf, int size) · 35 unmodified lines
3636 * simpler and there must be FF_INPUT_BUFFER_PADDING_SIZE
3737 * bytes at the end.
3838 */
39−# if HAVE_FAST_64BIT
39+#if HAVE_FAST_64BIT
4040 while (i < size &&
4141 !((~*(const uint64_t *)(buf + i) &
4242 (*(const uint64_t *)(buf + i) - 0x0101010101010101ULL)) &
4343 0x8080808080808080ULL))
4444 i += 8;
45−# else
45+#else
4646 while (i < size &&
4747 !((~*(const uint32_t *)(buf + i) &
4848 (*(const uint32_t *)(buf + i) - 0x01010101U)) &
4949 0x80808080U))
5050 i += 4;
51−# endif
51+#endif
5252 #endif
5353 for (; i < size; i++)
5454 if (!buf[i])
libavcodec/startcode.h+0−3
@@ -1,6 +1,4 @@
11 /*
2− * Copyright (c) 2003-2010 Michael Niedermayer <michaelni@gmx.at>
3− *
42 * This file is part of FFmpeg.
53 *
64 * FFmpeg is free software; you can redistribute it and/or
@@ -22,7 +20,6 @@ · 15 unmodified lines
2220 * @file
2321 * Accelerated start code search function for start codes common to
2422 * MPEG-1/2/4 video, VC-1, H.264/5
25− * @author Michael Niedermayer <michaelni@gmx.at>
2623 */
2724
2825 #ifndef AVCODEC_STARTCODE_H

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t