diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-06-23 05:48:30 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-06-23 05:48:30 +0400 |
commit | 56afbe8dbc6e508ba279bb95db542b940284fa7d (patch) | |
tree | 07d4be3dca4b6f63399a81c59a18867d8212892f | |
parent | ca350378de061a43d394dab2a649995f7f83274c (diff) | |
parent | 7b9ef8d701c319c26f7d0664fe977e176764c74e (diff) |
Merge commit '7b9ef8d701c319c26f7d0664fe977e176764c74e'
* commit '7b9ef8d701c319c26f7d0664fe977e176764c74e':
mpeg: Split error resilience bits off into a separate file
Conflicts:
configure
libavcodec/Makefile
libavcodec/mpegvideo.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rwxr-xr-x | configure | 24 | ||||
-rw-r--r-- | libavcodec/Makefile | 1 | ||||
-rw-r--r-- | libavcodec/h261dec.c | 1 | ||||
-rw-r--r-- | libavcodec/h263dec.c | 1 | ||||
-rw-r--r-- | libavcodec/mpeg12dec.c | 1 | ||||
-rw-r--r-- | libavcodec/mpeg_er.c | 60 | ||||
-rw-r--r-- | libavcodec/mpeg_er.h | 26 | ||||
-rw-r--r-- | libavcodec/mpegvideo.c | 41 | ||||
-rw-r--r-- | libavcodec/mpegvideo.h | 3 | ||||
-rw-r--r-- | libavcodec/mss2.c | 1 | ||||
-rw-r--r-- | libavcodec/rv10.c | 1 | ||||
-rw-r--r-- | libavcodec/rv34.c | 1 | ||||
-rw-r--r-- | libavcodec/vc1dec.c | 1 |
13 files changed, 107 insertions, 55 deletions
@@ -1818,6 +1818,7 @@ CONFIG_EXTRA=" llauddsp llviddsp lpc + mpeg_er mpegaudio mpegaudiodsp mpegvideo @@ -1995,6 +1996,7 @@ frame_thread_encoder_deps="encoders threads" intrax8_select="error_resilience" mdct_select="fft" rdft_select="fft" +mpeg_er_select="error_resilience" mpegaudio_select="mpegaudiodsp" mpegaudiodsp_select="dct" mpegvideo_select="blockdsp dsputil h264chroma hpeldsp videodsp" @@ -2063,9 +2065,9 @@ fourxm_decoder_select="blockdsp dsputil" fraps_decoder_select="dsputil huffman" g2m_decoder_select="blockdsp dsputil zlib" g729_decoder_select="dsputil" -h261_decoder_select="error_resilience mpegvideo" +h261_decoder_select="mpeg_er mpegvideo" h261_encoder_select="aandcttables mpegvideoenc" -h263_decoder_select="error_resilience h263_parser h263dsp mpegvideo qpeldsp" +h263_decoder_select="error_resilience h263_parser h263dsp mpeg_er mpegvideo qpeldsp" h263_encoder_select="aandcttables h263dsp mpegvideoenc" h263i_decoder_select="h263_decoder" h263p_encoder_select="h263_encoder" @@ -2106,9 +2108,9 @@ mpc7_decoder_select="dsputil mpegaudiodsp" mpc8_decoder_select="mpegaudiodsp" mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h" mpeg_xvmc_decoder_select="mpeg2video_decoder" -mpeg1video_decoder_select="error_resilience mpegvideo" +mpeg1video_decoder_select="error_resilience mpeg_er mpegvideo" mpeg1video_encoder_select="aandcttables mpegvideoenc h263dsp" -mpeg2video_decoder_select="error_resilience mpegvideo" +mpeg2video_decoder_select="error_resilience mpeg_er mpegvideo" mpeg2video_encoder_select="aandcttables mpegvideoenc h263dsp" mpeg4_decoder_select="h263_decoder mpeg4video_parser" mpeg4_encoder_select="h263_encoder" @@ -2117,7 +2119,7 @@ msmpeg4v2_decoder_select="h263_decoder" msmpeg4v2_encoder_select="h263_encoder" msmpeg4v3_decoder_select="h263_decoder" msmpeg4v3_encoder_select="h263_encoder" -mss2_decoder_select="error_resilience qpeldsp vc1_decoder" +mss2_decoder_select="error_resilience mpeg_er qpeldsp vc1_decoder" mxpeg_decoder_select="mjpeg_decoder" nellymoser_decoder_select="mdct sinewin" nellymoser_encoder_select="audio_frame_queue mdct sinewin" @@ -2134,12 +2136,12 @@ ra_144_encoder_select="audio_frame_queue lpc" ralf_decoder_select="golomb" rawvideo_decoder_select="dsputil" rtjpeg_decoder_select="dsputil" -rv10_decoder_select="error_resilience h263_decoder h263dsp" +rv10_decoder_select="error_resilience h263_decoder h263dsp mpeg_er" rv10_encoder_select="h263_encoder" -rv20_decoder_select="error_resilience h263_decoder h263dsp" +rv20_decoder_select="error_resilience h263_decoder h263dsp mpeg_er" rv20_encoder_select="h263_encoder" -rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo videodsp" -rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo videodsp" +rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo videodsp" +rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo videodsp" shorten_decoder_select="golomb" sipr_decoder_select="lsp" snow_decoder_select="dsputil dwt h264qpel hpeldsp rangecoder" @@ -2165,7 +2167,7 @@ twinvq_decoder_select="mdct lsp sinewin" utvideo_decoder_select="dsputil" utvideo_encoder_select="dsputil huffman huffyuvencdsp" vble_decoder_select="huffyuvdsp" -vc1_decoder_select="blockdsp error_resilience h263_decoder h264chroma h264qpel intrax8 qpeldsp" +vc1_decoder_select="blockdsp error_resilience h263_decoder h264chroma h264qpel intrax8 mpeg_er qpeldsp" vc1image_decoder_select="vc1_decoder" vorbis_decoder_select="mdct" vorbis_encoder_select="mdct" @@ -2271,7 +2273,7 @@ wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel" h264_parser_select="h264_decoder" hevc_parser_select="hevc_decoder" mpegvideo_parser_select="mpegvideo" -mpeg4video_parser_select="error_resilience h263dsp mpegvideo qpeldsp" +mpeg4video_parser_select="error_resilience h263dsp mpeg_er mpegvideo qpeldsp" vc1_parser_select="mpegvideo vc1_decoder" # external libraries diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 9924ea6aeb..d88c290253 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -65,6 +65,7 @@ OBJS-$(CONFIG_LLVIDDSP) += lossless_videodsp.o OBJS-$(CONFIG_LPC) += lpc.o OBJS-$(CONFIG_LSP) += lsp.o OBJS-$(CONFIG_MDCT) += mdct_fixed.o mdct_float.o mdct_fixed_32.o +OBJS-$(CONFIG_MPEG_ER) += mpeg_er.o OBJS-$(CONFIG_MPEGAUDIO) += mpegaudio.o mpegaudiodata.o \ mpegaudiodecheader.o OBJS-$(CONFIG_MPEGAUDIODSP) += mpegaudiodsp.o \ diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 1ceeff7ef3..7e63f29492 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -27,6 +27,7 @@ #include "libavutil/avassert.h" #include "avcodec.h" +#include "mpeg_er.h" #include "mpegutils.h" #include "mpegvideo.h" #include "h263.h" diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 7266cc7a37..31ec642e9f 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -34,6 +34,7 @@ #include "h263.h" #include "h263_parser.h" #include "internal.h" +#include "mpeg_er.h" #include "mpeg4video.h" #include "mpeg4video_parser.h" #include "mpegvideo.h" diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 0e8bcb02ec..92193ce916 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -37,6 +37,7 @@ #include "dsputil.h" #include "error_resilience.h" #include "internal.h" +#include "mpeg_er.h" #include "mpeg12.h" #include "mpeg12data.h" #include "mpegutils.h" diff --git a/libavcodec/mpeg_er.c b/libavcodec/mpeg_er.c new file mode 100644 index 0000000000..3d90582db3 --- /dev/null +++ b/libavcodec/mpeg_er.c @@ -0,0 +1,60 @@ +/* + * 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 + */ + +#include "error_resilience.h" +#include "mpegvideo.h" +#include "mpeg_er.h" + +static void set_erpic(ERPicture *dst, Picture *src) +{ + int i; + + memset(dst, 0, sizeof(*dst)); + if (!src) { + dst->f = NULL; + dst->tf = NULL; + return; + } + + dst->f = src->f; + dst->tf = &src->tf; + + for (i = 0; i < 2; i++) { + dst->motion_val[i] = src->motion_val[i]; + dst->ref_index[i] = src->ref_index[i]; + } + + dst->mb_type = src->mb_type; + dst->field_picture = src->field_picture; +} + +void ff_mpeg_er_frame_start(MpegEncContext *s) +{ + ERContext *er = &s->er; + + set_erpic(&er->cur_pic, s->current_picture_ptr); + set_erpic(&er->next_pic, s->next_picture_ptr); + set_erpic(&er->last_pic, s->last_picture_ptr); + + er->pp_time = s->pp_time; + er->pb_time = s->pb_time; + er->quarter_sample = s->quarter_sample; + er->partitioned_frame = s->partitioned_frame; + + ff_er_frame_start(er); +} diff --git a/libavcodec/mpeg_er.h b/libavcodec/mpeg_er.h new file mode 100644 index 0000000000..bd74fbb0c8 --- /dev/null +++ b/libavcodec/mpeg_er.h @@ -0,0 +1,26 @@ +/* + * 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 + */ + +#ifndef AVCODEC_MPEG_ER_H +#define AVCODEC_MPEG_ER_H + +#include "mpegvideo.h" + +void ff_mpeg_er_frame_start(MpegEncContext *s); + +#endif /* AVCODEC_MPEG_ER_H */ diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 6238545715..ffea7b0d04 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -3235,44 +3235,3 @@ void ff_MPV_report_decode_progress(MpegEncContext *s) if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame && !s->er.error_occurred) ff_thread_report_progress(&s->current_picture_ptr->tf, s->mb_y, 0); } - -#if CONFIG_ERROR_RESILIENCE -static void set_erpic(ERPicture *dst, Picture *src) -{ - int i; - - memset(dst, 0, sizeof(*dst)); - if (!src) { - dst->f = NULL; - dst->tf = NULL; - return; - } - - dst->f = src->f; - dst->tf = &src->tf; - - for (i = 0; i < 2; i++) { - dst->motion_val[i] = src->motion_val[i]; - dst->ref_index[i] = src->ref_index[i]; - } - - dst->mb_type = src->mb_type; - dst->field_picture = src->field_picture; -} - -void ff_mpeg_er_frame_start(MpegEncContext *s) -{ - ERContext *er = &s->er; - - set_erpic(&er->cur_pic, s->current_picture_ptr); - set_erpic(&er->next_pic, s->next_picture_ptr); - set_erpic(&er->last_pic, s->last_picture_ptr); - - er->pp_time = s->pp_time; - er->pb_time = s->pb_time; - er->quarter_sample = s->quarter_sample; - er->partitioned_frame = s->partitioned_frame; - - ff_er_frame_start(er); -} -#endif /* CONFIG_ERROR_RESILIENCE */ diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index 0cfe7af9ba..18eab28209 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -753,9 +753,6 @@ void ff_MPV_report_decode_progress(MpegEncContext *s); int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src); void ff_set_qscale(MpegEncContext * s, int qscale); -/* Error resilience */ -void ff_mpeg_er_frame_start(MpegEncContext *s); - int ff_dct_common_init(MpegEncContext *s); int ff_dct_encode_init(MpegEncContext *s); void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64], uint16_t (*qmat16)[2][64], diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c index 5f21b012f4..35c5d2722d 100644 --- a/libavcodec/mss2.c +++ b/libavcodec/mss2.c @@ -26,6 +26,7 @@ #include "libavutil/avassert.h" #include "error_resilience.h" #include "internal.h" +#include "mpeg_er.h" #include "msmpeg4data.h" #include "qpeldsp.h" #include "vc1.h" diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 3fb94c8ad7..f908a9a13a 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -33,6 +33,7 @@ #include "error_resilience.h" #include "h263.h" #include "internal.h" +#include "mpeg_er.h" #include "mpegvideo.h" #include "mpeg4video.h" diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c index 8ed4b5b284..873ec3c5a8 100644 --- a/libavcodec/rv34.c +++ b/libavcodec/rv34.c @@ -34,6 +34,7 @@ #include "golomb.h" #include "internal.h" #include "mathops.h" +#include "mpeg_er.h" #include "qpeldsp.h" #include "rectangle.h" #include "thread.h" diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index ca33f58244..455896a21c 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -29,6 +29,7 @@ #include "internal.h" #include "avcodec.h" #include "error_resilience.h" +#include "mpeg_er.h" #include "mpegutils.h" #include "mpegvideo.h" #include "h263.h" |