* MJPEG encoder.
*/
-//#define DEBUG
-#include <assert.h>
-
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
void ff_mjpeg_encode_picture_header(MpegEncContext *s)
{
- const int lossless= s->avctx->codec_id != CODEC_ID_MJPEG;
+ const int lossless= s->avctx->codec_id != AV_CODEC_ID_MJPEG;
int i;
put_marker(&s->pb, SOI);
// hack for AMV mjpeg format
- if(s->avctx->codec_id == CODEC_ID_AMV) goto end;
+ if(s->avctx->codec_id == AV_CODEC_ID_AMV) goto end;
jpeg_put_comments(s);
jpeg_table_header(s);
switch(s->avctx->codec_id){
- case CODEC_ID_MJPEG: put_marker(&s->pb, SOF0 ); break;
- case CODEC_ID_LJPEG: put_marker(&s->pb, SOF3 ); break;
- default: assert(0);
+ case AV_CODEC_ID_MJPEG: put_marker(&s->pb, SOF0 ); break;
+ case AV_CODEC_ID_LJPEG: put_marker(&s->pb, SOF3 ); break;
+ default: av_assert0(0);
}
put_bits(&s->pb, 16, 17);
put_bits(&s->pb, 8, lossless ? s->avctx->prediction_method+1 : 0); /* Ss (not used) */
switch(s->avctx->codec_id){
- case CODEC_ID_MJPEG: put_bits(&s->pb, 8, 63); break; /* Se (not used) */
- case CODEC_ID_LJPEG: put_bits(&s->pb, 8, 0); break; /* not used */
- default: assert(0);
+ case AV_CODEC_ID_MJPEG: put_bits(&s->pb, 8, 63); break; /* Se (not used) */
+ case AV_CODEC_ID_LJPEG: put_bits(&s->pb, 8, 0); break; /* not used */
+ default: av_assert0(0);
}
put_bits(&s->pb, 8, 0); /* Ah/Al (not used) */
uint8_t *buf= s->pb.buf + start;
int align= (-(size_t)(buf))&3;
- assert((size&7) == 0);
+ av_assert1((size&7) == 0);
size >>= 3;
ff_count=0;
void ff_mjpeg_encode_picture_trailer(MpegEncContext *s)
{
- assert((s->header_bits&7)==0);
+ av_assert1((s->header_bits&7)==0);
put_marker(&s->pb, EOI);
AVCodec ff_mjpeg_encoder = {
.name = "mjpeg",
.type = AVMEDIA_TYPE_VIDEO,
- .id = CODEC_ID_MJPEG,
+ .id = AV_CODEC_ID_MJPEG,
.priv_data_size = sizeof(MpegEncContext),
.init = ff_MPV_encode_init,
.encode2 = ff_MPV_encode_picture,
.close = ff_MPV_encode_end,
- .capabilities = CODEC_CAP_SLICE_THREADS,
+ .capabilities = CODEC_CAP_SLICE_THREADS | CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
.pix_fmts = (const enum PixelFormat[]){
PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_NONE
},
AVCodec ff_amv_encoder = {
.name = "amv",
.type = AVMEDIA_TYPE_VIDEO,
- .id = CODEC_ID_AMV,
+ .id = AV_CODEC_ID_AMV,
.priv_data_size = sizeof(MpegEncContext),
.init = ff_MPV_encode_init,
.encode2 = amv_encode_picture,