diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-09-08 17:10:48 +0200 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-09-08 17:10:48 +0200 |
commit | 5d8e836d0ec3bcaabf5bc2020210a1bc61975922 (patch) | |
tree | 8ff87745055d571431ded709218556357b18341c /libavcodec | |
parent | 151aa2ebff514a9d150a2d3a7b92be1dcc46df36 (diff) | |
download | ffmpeg-5d8e836d0ec3bcaabf5bc2020210a1bc61975922.tar.gz |
Replace all remaining occurances of step/depth_minus1 and offset_plus1
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dpxenc.c | 2 | ||||
-rw-r--r-- | libavcodec/ffv1dec.c | 2 | ||||
-rw-r--r-- | libavcodec/ffv1enc.c | 2 | ||||
-rw-r--r-- | libavcodec/huffyuvenc.c | 2 | ||||
-rw-r--r-- | libavcodec/jpeg2000dec.c | 8 | ||||
-rw-r--r-- | libavcodec/libopenjpegdec.c | 4 | ||||
-rw-r--r-- | libavcodec/mjpegdec.c | 2 | ||||
-rw-r--r-- | libavcodec/tiffenc.c | 2 | ||||
-rw-r--r-- | libavcodec/utils.c | 4 | ||||
-rw-r--r-- | libavcodec/x86/lossless_videodsp_init.c | 2 |
10 files changed, 15 insertions, 15 deletions
diff --git a/libavcodec/dpxenc.c b/libavcodec/dpxenc.c index 0d1dd1d510..9f3cbbe977 100644 --- a/libavcodec/dpxenc.c +++ b/libavcodec/dpxenc.c @@ -39,7 +39,7 @@ static av_cold int encode_init(AVCodecContext *avctx) const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); s->big_endian = !!(desc->flags & AV_PIX_FMT_FLAG_BE); - s->bits_per_component = desc->comp[0].depth_minus1 + 1; + s->bits_per_component = desc->comp[0].depth; s->num_components = desc->nb_components; s->descriptor = (desc->flags & AV_PIX_FMT_FLAG_ALPHA) ? 51 : 50; s->planar = !!(desc->flags & AV_PIX_FMT_FLAG_PLANAR); diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c index 162e41bcbf..557b1a0994 100644 --- a/libavcodec/ffv1dec.c +++ b/libavcodec/ffv1dec.c @@ -359,7 +359,7 @@ static int decode_slice(AVCodecContext *c, void *arg) FFV1Context *fs = *(void **)arg; FFV1Context *f = fs->avctx->priv_data; int width, height, x, y, ret; - const int ps = av_pix_fmt_desc_get(c->pix_fmt)->comp[0].step_minus1 + 1; + const int ps = av_pix_fmt_desc_get(c->pix_fmt)->comp[0].step; AVFrame * const p = f->cur; int i, si; diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c index 35d88ca244..265ced1172 100644 --- a/libavcodec/ffv1enc.c +++ b/libavcodec/ffv1enc.c @@ -1123,7 +1123,7 @@ static int encode_slice(AVCodecContext *c, void *arg) int x = fs->slice_x; int y = fs->slice_y; const AVFrame *const p = f->picture.f; - const int ps = av_pix_fmt_desc_get(c->pix_fmt)->comp[0].step_minus1 + 1; + const int ps = av_pix_fmt_desc_get(c->pix_fmt)->comp[0].step; int ret; RangeCoder c_bak = fs->c; const uint8_t *planes[3] = {p->data[0] + ps*x + y*p->linesize[0], diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c index 65b165aaa0..40044a4483 100644 --- a/libavcodec/huffyuvenc.c +++ b/libavcodec/huffyuvenc.c @@ -238,7 +238,7 @@ FF_DISABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS #endif - s->bps = desc->comp[0].depth_minus1 + 1; + s->bps = desc->comp[0].depth; s->yuv = !(desc->flags & AV_PIX_FMT_FLAG_RGB) && desc->nb_components >= 2; s->chroma = desc->nb_components > 2; s->alpha = !!(desc->flags & AV_PIX_FMT_FLAG_ALPHA); diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c index a414dc1ebf..ed286c6d8c 100644 --- a/libavcodec/jpeg2000dec.c +++ b/libavcodec/jpeg2000dec.c @@ -201,20 +201,20 @@ static int pix_fmt_match(enum AVPixelFormat pix_fmt, int components, switch (components) { case 4: - match = match && desc->comp[3].depth_minus1 + 1 >= bpc && + match = match && desc->comp[3].depth >= bpc && (log2_chroma_wh >> 14 & 3) == 0 && (log2_chroma_wh >> 12 & 3) == 0; case 3: - match = match && desc->comp[2].depth_minus1 + 1 >= bpc && + match = match && desc->comp[2].depth >= bpc && (log2_chroma_wh >> 10 & 3) == desc->log2_chroma_w && (log2_chroma_wh >> 8 & 3) == desc->log2_chroma_h; case 2: - match = match && desc->comp[1].depth_minus1 + 1 >= bpc && + match = match && desc->comp[1].depth >= bpc && (log2_chroma_wh >> 6 & 3) == desc->log2_chroma_w && (log2_chroma_wh >> 4 & 3) == desc->log2_chroma_h; case 1: - match = match && desc->comp[0].depth_minus1 + 1 >= bpc && + match = match && desc->comp[0].depth >= bpc && (log2_chroma_wh >> 2 & 3) == 0 && (log2_chroma_wh & 3) == 0 && (desc->flags & AV_PIX_FMT_FLAG_PAL) == pal8 * AV_PIX_FMT_FLAG_PAL; diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index 01ff48ce32..8539e2c9bd 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -204,7 +204,7 @@ static inline void libopenjpeg_copy_to_packed16(AVFrame *picture, opj_image_t *i int index, x, y, c; int adjust[4]; for (x = 0; x < image->numcomps; x++) - adjust[x] = FFMAX(FFMIN(desc->comp[x].depth_minus1 + 1 - image->comps[x].prec, 8), 0) + desc->comp[x].shift; + adjust[x] = FFMAX(FFMIN(desc->comp[x].depth - image->comps[x].prec, 8), 0) + desc->comp[x].shift; for (y = 0; y < picture->height; y++) { index = y * picture->width; @@ -241,7 +241,7 @@ static inline void libopenjpeg_copyto16(AVFrame *picture, opj_image_t *image) { int index, x, y; int adjust[4]; for (x = 0; x < image->numcomps; x++) - adjust[x] = FFMAX(FFMIN(desc->comp[x].depth_minus1 + 1 - image->comps[x].prec, 8), 0) + desc->comp[x].shift; + adjust[x] = FFMAX(FFMIN(desc->comp[x].depth - image->comps[x].prec, 8), 0) + desc->comp[x].shift; for (index = 0; index < image->numcomps; index++) { comp_data = image->comps[index].data; diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 818f8c9300..396f05ed1e 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -2158,7 +2158,7 @@ fail: return ret; the_end: - is16bit = av_pix_fmt_desc_get(s->avctx->pix_fmt)->comp[0].step_minus1; + is16bit = av_pix_fmt_desc_get(s->avctx->pix_fmt)->comp[0].step > 1; if (AV_RB32(s->upscale_h)) { int p; diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index fbbea1a7e1..3d37d2e084 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -311,7 +311,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, } for (i = 0; i < s->bpp_tab_size; i++) - bpp_tab[i] = desc->comp[i].depth_minus1 + 1; + bpp_tab[i] = desc->comp[i].depth; if (s->compr == TIFF_DEFLATE || s->compr == TIFF_ADOBE_DEFLATE || diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 5f3faf0e17..81bc2151ef 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -700,7 +700,7 @@ void avpriv_color_frame(AVFrame *frame, const int c[4]) int bytes = is_chroma ? FF_CEIL_RSHIFT(frame->width, desc->log2_chroma_w) : frame->width; int height = is_chroma ? FF_CEIL_RSHIFT(frame->height, desc->log2_chroma_h) : frame->height; for (y = 0; y < height; y++) { - if (desc->comp[0].depth_minus1 >= 8) { + if (desc->comp[0].depth >= 9) { for (x = 0; x<bytes; x++) ((uint16_t*)dst)[x] = c[p]; }else @@ -2705,7 +2705,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) "%s", enc->pix_fmt == AV_PIX_FMT_NONE ? "none" : av_get_pix_fmt_name(enc->pix_fmt)); if (enc->bits_per_raw_sample && enc->pix_fmt != AV_PIX_FMT_NONE && - enc->bits_per_raw_sample <= av_pix_fmt_desc_get(enc->pix_fmt)->comp[0].depth_minus1) + enc->bits_per_raw_sample < av_pix_fmt_desc_get(enc->pix_fmt)->comp[0].depth) av_strlcatf(detail, sizeof(detail), "%d bpc, ", enc->bits_per_raw_sample); if (enc->color_range != AVCOL_RANGE_UNSPECIFIED) av_strlcatf(detail, sizeof(detail), "%s, ", diff --git a/libavcodec/x86/lossless_videodsp_init.c b/libavcodec/x86/lossless_videodsp_init.c index 6589024a1a..b0fbcfef8f 100644 --- a/libavcodec/x86/lossless_videodsp_init.c +++ b/libavcodec/x86/lossless_videodsp_init.c @@ -42,7 +42,7 @@ void ff_llviddsp_init_x86(LLVidDSPContext *c, AVCodecContext *avctx) c->diff_int16 = ff_diff_int16_mmx; } - if (EXTERNAL_MMXEXT(cpu_flags) && pix_desc->comp[0].depth_minus1<15) { + if (EXTERNAL_MMXEXT(cpu_flags) && pix_desc->comp[0].depth<16) { c->add_hfyu_median_pred_int16 = ff_add_hfyu_median_pred_int16_mmxext; c->sub_hfyu_median_pred_int16 = ff_sub_hfyu_median_pred_int16_mmxext; } |