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