#include "golomb.h"
#include "internal.h"
#include "mathops.h"
-#include "dsputil.h"
#include "mjpeg.h"
#include "jpegls.h"
p->pict_type= AV_PICTURE_TYPE_I;
p->key_frame= 1;
- if(avctx->pix_fmt == PIX_FMT_GRAY8 || avctx->pix_fmt == PIX_FMT_GRAY16)
+ if(avctx->pix_fmt == AV_PIX_FMT_GRAY8 || avctx->pix_fmt == AV_PIX_FMT_GRAY16)
comps = 1;
else
comps = 3;
put_marker(&pb, SOI);
put_marker(&pb, SOF48);
put_bits(&pb, 16, 8 + comps * 3); // header size depends on components
- put_bits(&pb, 8, (avctx->pix_fmt == PIX_FMT_GRAY16) ? 16 : 8); // bpp
+ put_bits(&pb, 8, (avctx->pix_fmt == AV_PIX_FMT_GRAY16) ? 16 : 8); // bpp
put_bits(&pb, 16, avctx->height);
put_bits(&pb, 16, avctx->width);
put_bits(&pb, 8, comps); // components
state = av_mallocz(sizeof(JLSState));
/* initialize JPEG-LS state from JPEG parameters */
state->near = near;
- state->bpp = (avctx->pix_fmt == PIX_FMT_GRAY16) ? 16 : 8;
+ state->bpp = (avctx->pix_fmt == AV_PIX_FMT_GRAY16) ? 16 : 8;
ff_jpegls_reset_coding_parameters(state, 0);
ff_jpegls_init_state(state);
zero = av_mallocz(p->linesize[0]);
last = zero;
cur = p->data[0];
- if(avctx->pix_fmt == PIX_FMT_GRAY8){
+ if(avctx->pix_fmt == AV_PIX_FMT_GRAY8){
int t = 0;
for(i = 0; i < avctx->height; i++) {
last = cur;
cur += p->linesize[0];
}
- }else if(avctx->pix_fmt == PIX_FMT_GRAY16){
+ }else if(avctx->pix_fmt == AV_PIX_FMT_GRAY16){
int t = 0;
for(i = 0; i < avctx->height; i++) {
last = cur;
cur += p->linesize[0];
}
- }else if(avctx->pix_fmt == PIX_FMT_RGB24){
+ }else if(avctx->pix_fmt == AV_PIX_FMT_RGB24){
int j, width;
int Rc[3] = {0, 0, 0};
last = cur;
cur += s->picture.linesize[0];
}
- }else if(avctx->pix_fmt == PIX_FMT_BGR24){
+ }else if(avctx->pix_fmt == AV_PIX_FMT_BGR24){
int j, width;
int Rc[3] = {0, 0, 0};
c->avctx = ctx;
ctx->coded_frame = &c->picture;
- if(ctx->pix_fmt != PIX_FMT_GRAY8 && ctx->pix_fmt != PIX_FMT_GRAY16 && ctx->pix_fmt != PIX_FMT_RGB24 && ctx->pix_fmt != PIX_FMT_BGR24){
+ if(ctx->pix_fmt != AV_PIX_FMT_GRAY8 && ctx->pix_fmt != AV_PIX_FMT_GRAY16 && ctx->pix_fmt != AV_PIX_FMT_RGB24 && ctx->pix_fmt != AV_PIX_FMT_BGR24){
av_log(ctx, AV_LOG_ERROR, "Only grayscale and RGB24/BGR24 images are supported\n");
return -1;
}
AVCodec ff_jpegls_encoder = { //FIXME avoid MPV_* lossless JPEG should not need them
.name = "jpegls",
.type = AVMEDIA_TYPE_VIDEO,
- .id = CODEC_ID_JPEGLS,
+ .id = AV_CODEC_ID_JPEGLS,
.priv_data_size = sizeof(JpeglsContext),
.init = encode_init_ls,
.encode2 = encode_picture_ls,
- .pix_fmts = (const enum PixelFormat[]){
- PIX_FMT_BGR24, PIX_FMT_RGB24, PIX_FMT_GRAY8, PIX_FMT_GRAY16,
- PIX_FMT_NONE
+ .pix_fmts = (const enum AVPixelFormat[]){
+ AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16,
+ AV_PIX_FMT_NONE
},
.long_name = NULL_IF_CONFIG_SMALL("JPEG-LS"),
};