* @author Michael Niedermayer <michaelni@gmx.at>
*/
-#include "libavutil/attributes.h"
-#include "parser.h"
-#include "h264data.h"
+#include <assert.h>
+#include <stdint.h>
+
+#include "libavutil/avutil.h"
+#include "libavutil/error.h"
+#include "libavutil/log.h"
+#include "libavutil/mem.h"
+#include "libavutil/pixfmt.h"
+
+#include "get_bits.h"
#include "golomb.h"
+#include "h264.h"
+#include "h264data.h"
#include "internal.h"
#include "mpegutils.h"
-
-#include <assert.h>
+#include "parser.h"
typedef struct H264ParseContext {
H264Context h;
if ((h->pps.weighted_pred && sl->slice_type_nos == AV_PICTURE_TYPE_P) ||
(h->pps.weighted_bipred_idc == 1 && sl->slice_type_nos == AV_PICTURE_TYPE_B))
- ff_pred_weight_table(h, sl);
+ ff_h264_pred_weight_table(&sl->gb, &h->sps, sl->ref_count, sl->slice_type_nos,
+ &sl->pwt);
if (get_bits1(&sl->gb)) { // adaptive_ref_pic_marking_mode_flag
int i;
}
break;
}
- ptr = ff_h264_decode_nal(h, buf, &dst_length, &consumed, src_length);
+ ptr = ff_h264_decode_nal(h, sl, buf, &dst_length, &consumed, src_length);
if (!ptr || dst_length < 0)
break;
init_get_bits(&sl->gb, ptr, 8 * dst_length);
get_ue_golomb(&sl->gb); // skip first_mb_in_slice
slice_type = get_ue_golomb_31(&sl->gb);
- s->pict_type = golomb_to_pict_type[slice_type % 5];
+ s->pict_type = ff_h264_golomb_to_pict_type[slice_type % 5];
if (h->sei_recovery_frame_cnt >= 0) {
/* key frame, since recovery_frame_cnt is set */
s->key_frame = 1;
return 0;
}
-static void close(AVCodecParserContext *s)
+static void h264_close(AVCodecParserContext *s)
{
H264ParseContext *p = s->priv_data;
H264Context *h = &p->h;
return 0;
h->nb_slice_ctx = 1;
- h->thread_context[0] = h;
h->slice_context_count = 1;
ff_h264dsp_init(&h->h264dsp, 8, 1);
return 0;
.priv_data_size = sizeof(H264ParseContext),
.parser_init = init,
.parser_parse = h264_parse,
- .parser_close = close,
+ .parser_close = h264_close,
.split = h264_split,
};