* http://samples.libav.org/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov
*/
+#include <inttypes.h>
+
#include "libavutil/attributes.h"
#include "internal.h"
#include "avcodec.h"
-#include "mpegvideo.h"
+#include "mpegutils.h"
#include "h264.h"
#include "h264data.h" // FIXME FIXME FIXME
#include "golomb.h"
#include "hpeldsp.h"
#include "rectangle.h"
+#include "tpeldsp.h"
#if CONFIG_ZLIB
#include <zlib.h>
typedef struct {
H264Context h;
HpelDSPContext hdsp;
+ TpelDSPContext tdsp;
H264Picture *cur_pic;
H264Picture *next_pic;
H264Picture *last_pic;
src = h->edge_emu_buffer;
}
if (thirdpel)
- (avg ? h->dsp.avg_tpel_pixels_tab
- : h->dsp.put_tpel_pixels_tab)[dxy](dest, src, h->linesize,
- width, height);
+ (avg ? s->tdsp.avg_tpel_pixels_tab
+ : s->tdsp.put_tpel_pixels_tab)[dxy](dest, src, h->linesize,
+ width, height);
else
(avg ? s->hdsp.avg_pixels_tab
: s->hdsp.put_pixels_tab)[blocksize][dxy](dest, src, h->linesize,
src = h->edge_emu_buffer;
}
if (thirdpel)
- (avg ? h->dsp.avg_tpel_pixels_tab
- : h->dsp.put_tpel_pixels_tab)[dxy](dest, src,
- h->uvlinesize,
- width, height);
+ (avg ? s->tdsp.avg_tpel_pixels_tab
+ : s->tdsp.put_tpel_pixels_tab)[dxy](dest, src,
+ h->uvlinesize,
+ width, height);
else
(avg ? s->hdsp.avg_pixels_tab
: s->hdsp.put_pixels_tab)[blocksize][dxy](dest, src,
vlc = svq3_get_ue_golomb(&h->gb);
if (vlc >= 25) {
- av_log(h->avctx, AV_LOG_ERROR, "luma prediction:%d\n", vlc);
+ av_log(h->avctx, AV_LOG_ERROR,
+ "luma prediction:%"PRIu32"\n", vlc);
return -1;
}
if (!IS_INTRA16x16(mb_type) &&
(!IS_SKIP(mb_type) || h->pict_type == AV_PICTURE_TYPE_B)) {
if ((vlc = svq3_get_ue_golomb(&h->gb)) >= 48) {
- av_log(h->avctx, AV_LOG_ERROR, "cbp_vlc=%d\n", vlc);
+ av_log(h->avctx, AV_LOG_ERROR, "cbp_vlc=%"PRIu32"\n", vlc);
return -1;
}
}
if ((slice_id = svq3_get_ue_golomb(&h->gb)) >= 3) {
- av_log(h->avctx, AV_LOG_ERROR, "illegal slice type %d \n", slice_id);
+ av_log(h->avctx, AV_LOG_ERROR, "illegal slice type %u \n", slice_id);
return -1;
}
return -1;
ff_hpeldsp_init(&s->hdsp, avctx->flags);
+ ff_tpeldsp_init(&s->tdsp);
+
h->flags = avctx->flags;
h->is_complex = 1;
h->picture_structure = PICT_FRAME;
- avctx->pix_fmt = avctx->codec->pix_fmts[0];
+ avctx->pix_fmt = AV_PIX_FMT_YUVJ420P;
+ avctx->color_range = AVCOL_RANGE_JPEG;
h->chroma_qp[0] = h->chroma_qp[1] = 4;
h->chroma_x_shift = h->chroma_y_shift = 1;
return -1;
buf = av_malloc(buf_len);
- av_log(avctx, AV_LOG_DEBUG, "watermark size: %dx%d\n",
+ av_log(avctx, AV_LOG_DEBUG, "watermark size: %ux%u\n",
watermark_width, watermark_height);
av_log(avctx, AV_LOG_DEBUG,
"u1: %x u2: %x u3: %x compressed data size: %d offset: %d\n",
s->watermark_key = ff_svq1_packet_checksum(buf, buf_len, 0);
s->watermark_key = s->watermark_key << 16 | s->watermark_key;
av_log(avctx, AV_LOG_DEBUG,
- "watermark key %#x\n", s->watermark_key);
+ "watermark key %#"PRIx32"\n", s->watermark_key);
av_free(buf);
#else
av_log(avctx, AV_LOG_ERROR,