[FFmpeg-cvslog] Merge commit '56087ec0a29314d1860f6f0e6f40fbb9b40feccd'
Clément Bœsch
git at videolan.org
Mon Jun 20 12:33:09 CEST 2016
ffmpeg | branch: master | Clément Bœsch <clement at stupeflix.com> | Mon Jun 20 12:31:29 2016 +0200| [0ab1816315b01dae882a93db90e7f6709e6a71fd] | committer: Clément Bœsch
Merge commit '56087ec0a29314d1860f6f0e6f40fbb9b40feccd'
* commit '56087ec0a29314d1860f6f0e6f40fbb9b40feccd':
h264: drop a pointless indirection
Merged-by: Clément Bœsch <clement at stupeflix.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0ab1816315b01dae882a93db90e7f6709e6a71fd
---
libavcodec/h264.h | 5 -----
libavcodec/h264_mb_template.c | 18 ++++++++++++------
libavcodec/h264_mc_template.c | 4 ++--
libavcodec/h264_slice.c | 3 ---
4 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 0cda191..60355bf 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -687,11 +687,6 @@ typedef struct H264Context {
AVBufferPool *mb_type_pool;
AVBufferPool *motion_val_pool;
AVBufferPool *ref_index_pool;
-
- /* Motion Estimation */
- qpel_mc_func (*qpel_put)[16];
- qpel_mc_func (*qpel_avg)[16];
-
} H264Context;
extern const uint16_t ff_h264_mb_sizes[4];
diff --git a/libavcodec/h264_mb_template.c b/libavcodec/h264_mb_template.c
index f582b00..d5ea26a 100644
--- a/libavcodec/h264_mb_template.c
+++ b/libavcodec/h264_mb_template.c
@@ -170,14 +170,18 @@ static av_noinline void FUNC(hl_decode_mb)(const H264Context *h, H264SliceContex
} else {
if (chroma422) {
FUNC(hl_motion_422)(h, sl, dest_y, dest_cb, dest_cr,
- h->qpel_put, h->h264chroma.put_h264_chroma_pixels_tab,
- h->qpel_avg, h->h264chroma.avg_h264_chroma_pixels_tab,
+ h->h264qpel.put_h264_qpel_pixels_tab,
+ h->h264chroma.put_h264_chroma_pixels_tab,
+ h->h264qpel.avg_h264_qpel_pixels_tab,
+ h->h264chroma.avg_h264_chroma_pixels_tab,
h->h264dsp.weight_h264_pixels_tab,
h->h264dsp.biweight_h264_pixels_tab);
} else {
FUNC(hl_motion_420)(h, sl, dest_y, dest_cb, dest_cr,
- h->qpel_put, h->h264chroma.put_h264_chroma_pixels_tab,
- h->qpel_avg, h->h264chroma.avg_h264_chroma_pixels_tab,
+ h->h264qpel.put_h264_qpel_pixels_tab,
+ h->h264chroma.put_h264_chroma_pixels_tab,
+ h->h264qpel.avg_h264_qpel_pixels_tab,
+ h->h264chroma.avg_h264_chroma_pixels_tab,
h->h264dsp.weight_h264_pixels_tab,
h->h264dsp.biweight_h264_pixels_tab);
}
@@ -333,8 +337,10 @@ static av_noinline void FUNC(hl_decode_mb_444)(const H264Context *h, H264SliceCo
linesize, 0, 1, SIMPLE, PIXEL_SHIFT);
} else {
FUNC(hl_motion_444)(h, sl, dest[0], dest[1], dest[2],
- h->qpel_put, h->h264chroma.put_h264_chroma_pixels_tab,
- h->qpel_avg, h->h264chroma.avg_h264_chroma_pixels_tab,
+ h->h264qpel.put_h264_qpel_pixels_tab,
+ h->h264chroma.put_h264_chroma_pixels_tab,
+ h->h264qpel.avg_h264_qpel_pixels_tab,
+ h->h264chroma.avg_h264_chroma_pixels_tab,
h->h264dsp.weight_h264_pixels_tab,
h->h264dsp.biweight_h264_pixels_tab);
}
diff --git a/libavcodec/h264_mc_template.c b/libavcodec/h264_mc_template.c
index bf8f0ad..cd4a04e 100644
--- a/libavcodec/h264_mc_template.c
+++ b/libavcodec/h264_mc_template.c
@@ -64,9 +64,9 @@ static void mc_part(const H264Context *h, H264SliceContext *sl,
static void MCFUNC(hl_motion)(const H264Context *h, H264SliceContext *sl,
uint8_t *dest_y,
uint8_t *dest_cb, uint8_t *dest_cr,
- qpel_mc_func(*qpix_put)[16],
+ const qpel_mc_func(*qpix_put)[16],
const h264_chroma_mc_func(*chroma_put),
- qpel_mc_func(*qpix_avg)[16],
+ const qpel_mc_func(*qpix_avg)[16],
const h264_chroma_mc_func(*chroma_avg),
const h264_weight_func *weight_op,
const h264_biweight_func *weight_avg)
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index c303051..0365e9b 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1059,9 +1059,6 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
if (first_slice)
av_assert0(!h->setup_finished);
- h->qpel_put = h->h264qpel.put_h264_qpel_pixels_tab;
- h->qpel_avg = h->h264qpel.avg_h264_qpel_pixels_tab;
-
first_mb_in_slice = get_ue_golomb_long(&sl->gb);
if (first_mb_in_slice == 0) { // FIXME better field boundary detection
======================================================================
diff --cc libavcodec/h264_slice.c
index c303051,ee4b74a..0365e9b
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@@ -1049,54 -929,19 +1049,51 @@@ int ff_h264_decode_slice_header(H264Con
int ret;
unsigned int slice_type, tmp, i, j;
int last_pic_structure, last_pic_droppable;
+ int must_reinit;
int needs_reinit = 0;
int field_pic_flag, bottom_field_flag;
+ int first_slice = sl == h->slice_ctx && !h->current_slice;
int frame_num, droppable, picture_structure;
- int mb_aff_frame = 0;
+ int mb_aff_frame, last_mb_aff_frame;
+
+ if (first_slice)
+ av_assert0(!h->setup_finished);
- h->qpel_put = h->h264qpel.put_h264_qpel_pixels_tab;
- h->qpel_avg = h->h264qpel.avg_h264_qpel_pixels_tab;
-
- first_mb_in_slice = get_ue_golomb(&sl->gb);
+ first_mb_in_slice = get_ue_golomb_long(&sl->gb);
if (first_mb_in_slice == 0) { // FIXME better field boundary detection
- if (h->current_slice && h->cur_pic_ptr && FIELD_PICTURE(h)) {
- ff_h264_field_end(h, sl, 1);
+ if (h->current_slice) {
+ if (h->setup_finished) {
+ av_log(h->avctx, AV_LOG_ERROR, "Too many fields\n");
+ return AVERROR_INVALIDDATA;
+ }
+ if (h->max_contexts > 1) {
+ if (!h->single_decode_warning) {
+ av_log(h->avctx, AV_LOG_WARNING, "Cannot decode multiple access units as slice threads\n");
+ h->single_decode_warning = 1;
+ }
+ h->max_contexts = 1;
+ return SLICE_SINGLETHREAD;
+ }
+
+ if (h->cur_pic_ptr && FIELD_PICTURE(h) && h->first_field) {
+ ret = ff_h264_field_end(h, h->slice_ctx, 1);
+ h->current_slice = 0;
+ if (ret < 0)
+ return ret;
+ } else if (h->cur_pic_ptr && !FIELD_PICTURE(h) && !h->first_field && h->nal_unit_type == NAL_IDR_SLICE) {
+ av_log(h, AV_LOG_WARNING, "Broken frame packetizing\n");
+ ret = ff_h264_field_end(h, h->slice_ctx, 1);
+ h->current_slice = 0;
+ ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, 0);
+ ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX, 1);
+ h->cur_pic_ptr = NULL;
+ if (ret < 0)
+ return ret;
+ } else
+ return AVERROR_INVALIDDATA;
}
- h->current_slice = 0;
if (!h->first_field) {
if (h->cur_pic_ptr && !h->droppable) {
ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
More information about the ffmpeg-cvslog
mailing list