mirror of https://git.ffmpeg.org/ffmpeg.git
Merge commit '75644335b907919057960716508477239c26fed4'
* commit '75644335b907919057960716508477239c26fed4': lavc: Move start code finding to utils.c Conflicts: configure libavcodec/mpegvideo.c libavcodec/utils.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
2cdedcbcea
|
@ -1699,7 +1699,7 @@ atrac3_decoder_select="mdct"
|
||||||
bink_decoder_select="dsputil hpeldsp"
|
bink_decoder_select="dsputil hpeldsp"
|
||||||
binkaudio_dct_decoder_select="mdct rdft dct sinewin"
|
binkaudio_dct_decoder_select="mdct rdft dct sinewin"
|
||||||
binkaudio_rdft_decoder_select="mdct rdft sinewin"
|
binkaudio_rdft_decoder_select="mdct rdft sinewin"
|
||||||
cavs_decoder_select="dsputil golomb h264chroma mpegvideo videodsp"
|
cavs_decoder_select="dsputil golomb h264chroma videodsp"
|
||||||
cllc_decoder_select="dsputil"
|
cllc_decoder_select="dsputil"
|
||||||
comfortnoise_encoder_select="lpc"
|
comfortnoise_encoder_select="lpc"
|
||||||
cook_decoder_select="dsputil mdct sinewin"
|
cook_decoder_select="dsputil mdct sinewin"
|
||||||
|
@ -1987,13 +1987,12 @@ mov_demuxer_suggest="zlib"
|
||||||
mov_muxer_select="rtpenc_chain"
|
mov_muxer_select="rtpenc_chain"
|
||||||
mp3_demuxer_select="mpegaudio_parser"
|
mp3_demuxer_select="mpegaudio_parser"
|
||||||
mp4_muxer_select="mov_muxer"
|
mp4_muxer_select="mov_muxer"
|
||||||
mpegts_muxer_select="adts_muxer latm_muxer mpegvideo"
|
mpegts_muxer_select="adts_muxer latm_muxer"
|
||||||
mpegtsraw_demuxer_select="mpegts_demuxer"
|
mpegtsraw_demuxer_select="mpegts_demuxer"
|
||||||
mxf_d10_muxer_select="mxf_muxer"
|
mxf_d10_muxer_select="mxf_muxer"
|
||||||
ogg_demuxer_select="golomb"
|
ogg_demuxer_select="golomb"
|
||||||
psp_muxer_select="mov_muxer"
|
psp_muxer_select="mov_muxer"
|
||||||
rtp_demuxer_select="sdp_demuxer"
|
rtp_demuxer_select="sdp_demuxer"
|
||||||
rtp_muxer_select="mpegvideo"
|
|
||||||
rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer"
|
rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer"
|
||||||
rtsp_demuxer_select="http_protocol rtpdec"
|
rtsp_demuxer_select="http_protocol rtpdec"
|
||||||
rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
|
rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
|
||||||
|
|
|
@ -156,39 +156,6 @@ static void mpeg_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type,
|
||||||
ff_MPV_decode_mb(s, s->block);
|
ff_MPV_decode_mb(s, s->block);
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t *avpriv_mpv_find_start_code(const uint8_t *av_restrict p,
|
|
||||||
const uint8_t *end,
|
|
||||||
uint32_t *av_restrict state)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
|
|
||||||
assert(p <= end);
|
|
||||||
if (p >= end)
|
|
||||||
return end;
|
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
|
||||||
uint32_t tmp = *state << 8;
|
|
||||||
*state = tmp + *(p++);
|
|
||||||
if (tmp == 0x100 || p == end)
|
|
||||||
return p;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (p < end) {
|
|
||||||
if (p[-1] > 1 ) p += 3;
|
|
||||||
else if (p[-2] ) p += 2;
|
|
||||||
else if (p[-3]|(p[-1]-1)) p++;
|
|
||||||
else {
|
|
||||||
p++;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
p = FFMIN(p, end) - 4;
|
|
||||||
*state = AV_RB32(p);
|
|
||||||
|
|
||||||
return p + 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* init common dct for both encoder and decoder */
|
/* init common dct for both encoder and decoder */
|
||||||
av_cold int ff_dct_common_init(MpegEncContext *s)
|
av_cold int ff_dct_common_init(MpegEncContext *s)
|
||||||
{
|
{
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "dsputil.h"
|
#include "dsputil.h"
|
||||||
#include "libavutil/opt.h"
|
#include "libavutil/opt.h"
|
||||||
|
#include "mpegvideo.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "frame_thread_encoder.h"
|
#include "frame_thread_encoder.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
@ -3098,3 +3099,36 @@ int avpriv_bprint_to_extradata(AVCodecContext *avctx, struct AVBPrint *buf)
|
||||||
avctx->extradata_size = buf->len;
|
avctx->extradata_size = buf->len;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const uint8_t *avpriv_mpv_find_start_code(const uint8_t *av_restrict p,
|
||||||
|
const uint8_t *end,
|
||||||
|
uint32_t *av_restrict state)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
assert(p <= end);
|
||||||
|
if (p >= end)
|
||||||
|
return end;
|
||||||
|
|
||||||
|
for (i = 0; i < 3; i++) {
|
||||||
|
uint32_t tmp = *state << 8;
|
||||||
|
*state = tmp + *(p++);
|
||||||
|
if (tmp == 0x100 || p == end)
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
while (p < end) {
|
||||||
|
if (p[-1] > 1 ) p += 3;
|
||||||
|
else if (p[-2] ) p += 2;
|
||||||
|
else if (p[-3]|(p[-1]-1)) p++;
|
||||||
|
else {
|
||||||
|
p++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
p = FFMIN(p, end) - 4;
|
||||||
|
*state = AV_RB32(p);
|
||||||
|
|
||||||
|
return p + 4;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue