summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-01-19 21:58:12 +0100
committerAnton Khirnov <anton@khirnov.net>2015-01-27 09:10:12 +0100
commit167e004e1aca7765686ed95d7cd8ea5064d4f6f6 (patch)
tree89e5b1b4c1d90289e211c63a25c5dc17df0ec13c /libavcodec
parent58ae8d595724150c407ca2c2df3aa4bd5580397c (diff)
h264: drop any pretense of support for data partitioning
It does not work correctly and apparently never did. There is no indication that this (mis)feature is ever used in the wild or even that any software other than the reference supports it. Since the code that attempts to support it adds some nontrivial complexity and has resulted in several bugs in the past, it is better to just drop it.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264.c45
-rw-r--r--libavcodec/h264.h1
-rw-r--r--libavcodec/h264_slice.c1
3 files changed, 3 insertions, 44 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 2aea35e09d..be0dca4959 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1499,7 +1499,6 @@ again:
init_get_bits(&hx->gb, ptr, bit_length);
hx->intra_gb_ptr =
hx->inter_gb_ptr = &hx->gb;
- hx->data_partitioning = 0;
if ((err = ff_h264_decode_slice_header(hx, h)))
break;
@@ -1552,46 +1551,11 @@ again:
}
break;
case NAL_DPA:
- if (h->avctx->flags & CODEC_FLAG2_CHUNKS) {
- av_log(h->avctx, AV_LOG_ERROR,
- "Decoding in chunks is not supported for "
- "partitioned slices.\n");
- return AVERROR(ENOSYS);
- }
-
- init_get_bits(&hx->gb, ptr, bit_length);
- hx->intra_gb_ptr =
- hx->inter_gb_ptr = NULL;
-
- if ((err = ff_h264_decode_slice_header(hx, h)) < 0) {
- /* make sure data_partitioning is cleared if it was set
- * before, so we don't try decoding a slice without a valid
- * slice header later */
- h->data_partitioning = 0;
- break;
- }
-
- hx->data_partitioning = 1;
- break;
case NAL_DPB:
- init_get_bits(&hx->intra_gb, ptr, bit_length);
- hx->intra_gb_ptr = &hx->intra_gb;
- break;
case NAL_DPC:
- init_get_bits(&hx->inter_gb, ptr, bit_length);
- hx->inter_gb_ptr = &hx->inter_gb;
-
- if (hx->redundant_pic_count == 0 &&
- hx->intra_gb_ptr &&
- hx->data_partitioning &&
- h->cur_pic_ptr && h->context_initialized &&
- (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc) &&
- (avctx->skip_frame < AVDISCARD_BIDIR ||
- hx->slice_type_nos != AV_PICTURE_TYPE_B) &&
- (avctx->skip_frame < AVDISCARD_NONKEY ||
- hx->slice_type_nos == AV_PICTURE_TYPE_I) &&
- avctx->skip_frame < AVDISCARD_ALL)
- context_count++;
+ avpriv_request_sample(avctx, "data partitioning");
+ ret = AVERROR(ENOSYS);
+ goto end;
break;
case NAL_SEI:
init_get_bits(&h->gb, ptr, bit_length);
@@ -1718,9 +1682,6 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data,
int ret;
h->flags = avctx->flags;
- /* reset data partitioning here, to ensure GetBitContexts from previous
- * packets do not get used. */
- h->data_partitioning = 0;
/* end of stream, output what is still in the buffers */
out:
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index ad365498b2..37e4cf41ff 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -324,7 +324,6 @@ typedef struct H264Context {
int qscale;
int droppable;
- int data_partitioning;
int coded_picture_number;
int low_delay;
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index e291aab6d6..4eb2767a5c 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1127,7 +1127,6 @@ static int h264_slice_header_init(H264Context *h, int reinit)
c->chroma_y_shift = h->chroma_y_shift;
c->qscale = h->qscale;
c->droppable = h->droppable;
- c->data_partitioning = h->data_partitioning;
c->low_delay = h->low_delay;
c->mb_width = h->mb_width;
c->mb_height = h->mb_height;