* 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
Unified · Split
| @@ -1853,6 +1853,7 @@ CONFIG_EXTRA=" · 1852 unmodified lines | ||
| 1853 | 1853 | rtpdec |
| 1854 | 1854 | rtpenc_chain |
| 1855 | 1855 | sinewin |
| 1856 | + startcode | |
| 1856 | 1857 | tpeldsp |
| 1857 | 1858 | videodsp |
| 1858 | 1859 | vp3dsp |
| @@ -2095,7 +2096,7 @@ h263_decoder_select="error_resilience h263_parser h263dsp mpeg_er mpegvideo qpel · 236 unmodified lines | ||
| 2095 | 2096 | h263_encoder_select="aandcttables h263dsp mpegvideoenc" |
| 2096 | 2097 | h263i_decoder_select="h263_decoder" |
| 2097 | 2098 | 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" | |
| 2099 | 2100 | h264_decoder_suggest="error_resilience" |
| 2100 | 2101 | hevc_decoder_select="bswapdsp cabac golomb videodsp" |
| 2101 | 2102 | huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp" |
| @@ -54,7 +54,7 @@ OBJS-$(CONFIG_FFT) += avfft.o fft_fixed.o fft_float.o \ · 53 unmodified lines | ||
| 54 | 54 | OBJS-$(CONFIG_GOLOMB) += golomb.o |
| 55 | 55 | OBJS-$(CONFIG_H263DSP) += h263dsp.o |
| 56 | 56 | OBJS-$(CONFIG_H264CHROMA) += h264chroma.o |
| 57 | −OBJS-$(CONFIG_H264DSP) += h264dsp.o h264idct.o startcode.o | |
| 57 | +OBJS-$(CONFIG_H264DSP) += h264dsp.o h264idct.o | |
| 58 | 58 | OBJS-$(CONFIG_H264PRED) += h264pred.o |
| 59 | 59 | OBJS-$(CONFIG_H264QPEL) += h264qpel.o |
| 60 | 60 | OBJS-$(CONFIG_HPELDSP) += hpeldsp.o |
| @@ -91,6 +91,7 @@ RDFT-OBJS-$(CONFIG_HARDCODED_TABLES) += sin_tables.o · 30 unmodified lines | ||
| 91 | 91 | OBJS-$(CONFIG_RDFT) += rdft.o $(RDFT-OBJS-yes) |
| 92 | 92 | OBJS-$(CONFIG_SHARED) += log2_tab.o |
| 93 | 93 | OBJS-$(CONFIG_SINEWIN) += sinewin.o |
| 94 | +OBJS-$(CONFIG_STARTCODE) += startcode.o | |
| 94 | 95 | OBJS-$(CONFIG_TPELDSP) += tpeldsp.o |
| 95 | 96 | OBJS-$(CONFIG_VAAPI) += vaapi.o |
| 96 | 97 | OBJS-$(CONFIG_VDA) += vda.o |
| @@ -54,7 +54,6 @@ ARMV5TE-OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_armv5te.o \ · 53 unmodified lines | ||
| 54 | 54 | ARMV5TE-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv5te.o |
| 55 | 55 | |
| 56 | 56 | ARMV6-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_armv6.o |
| 57 | −ARMV6-OBJS-$(CONFIG_H264DSP) += arm/startcode_armv6.o | |
| 58 | 57 | ARMV6-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_armv6.o \ |
| 59 | 58 | arm/hpeldsp_armv6.o |
| 60 | 59 | ARMV6-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_armv6.o \ |
| @@ -66,6 +65,7 @@ ARMV6-OBJS-$(CONFIG_MPEGVIDEOENC) += arm/mpegvideoencdsp_armv6.o · 5 unmodified lines | ||
| 66 | 65 | ARMV6-OBJS-$(CONFIG_PIXBLOCKDSP) += arm/pixblockdsp_armv6.o |
| 67 | 66 | |
| 68 | 67 | ARMV6-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv6.o |
| 68 | +ARMV6-OBJS-$(CONFIG_STARTCODE) += arm/startcode_armv6.o | |
| 69 | 69 | ARMV6-OBJS-$(CONFIG_VC1_DECODER) += arm/startcode_armv6.o |
| 70 | 70 | ARMV6-OBJS-$(CONFIG_VC1_PARSER) += arm/startcode_armv6.o |
| 71 | 71 | ARMV6-OBJS-$(CONFIG_VP7_DECODER) += arm/vp8_armv6.o \ |
| @@ -23,8 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | #include "libavutil/attributes.h" |
| 24 | 24 | #include "libavutil/arm/cpu.h" |
| 25 | 25 | #include "libavcodec/h264dsp.h" |
| 26 | − | |
| 27 | −int ff_startcode_find_candidate_armv6(const uint8_t *buf, int size); | |
| 26 | +#include "libavcodec/arm/startcode.h" | |
| 28 | 27 | |
| 29 | 28 | void ff_h264_v_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha, |
| 30 | 29 | 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 | ||
| 109 | 108 | int cpu_flags = av_get_cpu_flags(); |
| 110 | 109 | |
| 111 | 110 | 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; | |
| 113 | 112 | if (have_neon(cpu_flags)) |
| 114 | 113 | h264dsp_init_neon(c, bit_depth, chroma_format_idc); |
| 115 | 114 | } |
| @@ -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 */ | |
| @@ -66,7 +66,7 @@ static int h264_find_frame_end(H264Context *h, const uint8_t *buf, · 65 unmodified lines | ||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | 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); | |
| 70 | 70 | if (i < next_avc) |
| 71 | 71 | state = 2; |
| 72 | 72 | } else if (state <= 2) { |
| @@ -151,7 +151,7 @@ av_cold void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, · 150 unmodified lines | ||
| 151 | 151 | H264_DSP(8); |
| 152 | 152 | break; |
| 153 | 153 | } |
| 154 | − c->h264_find_start_code_candidate = ff_startcode_find_candidate_c; | |
| 154 | + c->startcode_find_candidate = ff_startcode_find_candidate_c; | |
| 155 | 155 | |
| 156 | 156 | if (ARCH_AARCH64) ff_h264dsp_init_aarch64(c, bit_depth, chroma_format_idc); |
| 157 | 157 | if (ARCH_ARM) ff_h264dsp_init_arm(c, bit_depth, chroma_format_idc); |
| @@ -113,7 +113,7 @@ typedef struct H264DSPContext { · 112 unmodified lines | ||
| 113 | 113 | * one or more further zero bytes and a one byte. Better still, filter |
| 114 | 114 | * out any bytes that form the trailing_zero_8bits syntax element too. |
| 115 | 115 | */ |
| 116 | − int (*h264_find_start_code_candidate)(const uint8_t *buf, int size); | |
| 116 | + int (*startcode_find_candidate)(const uint8_t *buf, int size); | |
| 117 | 117 | } H264DSPContext; |
| 118 | 118 | |
| 119 | 119 | void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, |
| @@ -36,19 +36,19 @@ int ff_startcode_find_candidate_c(const uint8_t *buf, int size) · 35 unmodified lines | ||
| 36 | 36 | * simpler and there must be FF_INPUT_BUFFER_PADDING_SIZE |
| 37 | 37 | * bytes at the end. |
| 38 | 38 | */ |
| 39 | −# if HAVE_FAST_64BIT | |
| 39 | +#if HAVE_FAST_64BIT | |
| 40 | 40 | while (i < size && |
| 41 | 41 | !((~*(const uint64_t *)(buf + i) & |
| 42 | 42 | (*(const uint64_t *)(buf + i) - 0x0101010101010101ULL)) & |
| 43 | 43 | 0x8080808080808080ULL)) |
| 44 | 44 | i += 8; |
| 45 | −# else | |
| 45 | +#else | |
| 46 | 46 | while (i < size && |
| 47 | 47 | !((~*(const uint32_t *)(buf + i) & |
| 48 | 48 | (*(const uint32_t *)(buf + i) - 0x01010101U)) & |
| 49 | 49 | 0x80808080U)) |
| 50 | 50 | i += 4; |
| 51 | −# endif | |
| 51 | +#endif | |
| 52 | 52 | #endif |
| 53 | 53 | for (; i < size; i++) |
| 54 | 54 | if (!buf[i]) |
| @@ -1,6 +1,4 @@ | ||
| 1 | 1 | /* |
| 2 | − * Copyright (c) 2003-2010 Michael Niedermayer <michaelni@gmx.at> | |
| 3 | − * | |
| 4 | 2 | * This file is part of FFmpeg. |
| 5 | 3 | * |
| 6 | 4 | * FFmpeg is free software; you can redistribute it and/or |
| @@ -22,7 +20,6 @@ · 15 unmodified lines | ||
| 22 | 20 | * @file |
| 23 | 21 | * Accelerated start code search function for start codes common to |
| 24 | 22 | * MPEG-1/2/4 video, VC-1, H.264/5 |
| 25 | − * @author Michael Niedermayer <michaelni@gmx.at> | |
| 26 | 23 | */ |
| 27 | 24 | |
| 28 | 25 | #ifndef AVCODEC_STARTCODE_H |