avcodec/cfhd: support cropped height tag
Ported from libav. Authored by one of the following: Anton Khirnov <anton@khirnov.net> Diego Biurrun <diego@biurrun.de> Vittorio Giovara <vittorio.giovara@gmail.com> Reviewed-by: kierank Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
df45ea45df
commit
d2917501c2
@ -73,6 +73,7 @@ static void init_frame_defaults(CFHDContext *s)
|
|||||||
{
|
{
|
||||||
s->coded_width = 0;
|
s->coded_width = 0;
|
||||||
s->coded_height = 0;
|
s->coded_height = 0;
|
||||||
|
s->cropped_height = 0;
|
||||||
s->bpc = 10;
|
s->bpc = 10;
|
||||||
s->channel_cnt = 4;
|
s->channel_cnt = 4;
|
||||||
s->subband_cnt = SUBBAND_COUNT;
|
s->subband_cnt = SUBBAND_COUNT;
|
||||||
@ -455,6 +456,9 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
planes = av_pix_fmt_count_planes(s->coded_format);
|
planes = av_pix_fmt_count_planes(s->coded_format);
|
||||||
|
} else if (tag == -85) {
|
||||||
|
av_log(avctx, AV_LOG_DEBUG, "Cropped height %"PRIu16"\n", data);
|
||||||
|
s->cropped_height = data;
|
||||||
} else
|
} else
|
||||||
av_log(avctx, AV_LOG_DEBUG, "Unknown tag %i data %x\n", tag, data);
|
av_log(avctx, AV_LOG_DEBUG, "Unknown tag %i data %x\n", tag, data);
|
||||||
|
|
||||||
@ -472,6 +476,8 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame,
|
|||||||
ret = ff_set_dimensions(avctx, s->coded_width, s->coded_height);
|
ret = ff_set_dimensions(avctx, s->coded_width, s->coded_height);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
if (s->cropped_height)
|
||||||
|
avctx->height = s->cropped_height;
|
||||||
frame.f->width =
|
frame.f->width =
|
||||||
frame.f->height = 0;
|
frame.f->height = 0;
|
||||||
|
|
||||||
|
@ -81,6 +81,7 @@ typedef struct CFHDContext {
|
|||||||
|
|
||||||
int coded_width;
|
int coded_width;
|
||||||
int coded_height;
|
int coded_height;
|
||||||
|
int cropped_height;
|
||||||
enum AVPixelFormat coded_format;
|
enum AVPixelFormat coded_format;
|
||||||
|
|
||||||
int a_width;
|
int a_width;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user