Skip to content

Commit

Permalink
libhb: expose a hb_get_chroma_sub_sample function, useful to read the…
Browse files Browse the repository at this point in the history
… current title and job chroma subsampling.
  • Loading branch information
galad87 committed Apr 25, 2022
1 parent 4693f09 commit 123d7c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libhb/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -6097,6 +6097,11 @@ int hb_get_bit_depth(int format)
return max;
}

int hb_get_chroma_sub_sample(int format, int *h_shift, int *v_shift)
{
return av_pix_fmt_get_chroma_sub_sample(format, h_shift, v_shift);
}

static int pix_fmt_is_supported(hb_job_t *job, int pix_fmt)
{
const int title_bit_depth = hb_get_bit_depth(job->title->pix_fmt);
Expand Down
1 change: 1 addition & 0 deletions libhb/handbrake/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -1508,6 +1508,7 @@ int hb_output_color_transfer(hb_job_t * job);
int hb_output_color_matrix(hb_job_t * job);

int hb_get_bit_depth(int format);
int hb_get_chroma_sub_sample(int format, int *h_shift, int *v_shift);
int hb_get_best_pix_fmt(hb_job_t * job);

#define HB_NEG_FLOAT_REG "(([-])?(([0-9]+([.,][0-9]+)?)|([.,][0-9]+))"
Expand Down

0 comments on commit 123d7c4

Please sign in to comment.