Skip to content

Commit

Permalink
fix-345 by checking in MC whether bit-depths match (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Jan 24, 2023
1 parent c96962c commit fbd0b3a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions libde265/de265.cc
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ LIBDE265_API const char* de265_get_error_text(de265_error err)
return "collocated motion-vector is outside image area";
case DE265_WARNING_PCM_BITDEPTH_TOO_LARGE:
return "PCM bit-depth too large";
case DE265_WARNING_REFERENCE_IMAGE_BIT_DEPTH_DOES_NOT_MATCH:
return "Bit-depth of reference image does not match current image";

default: return "unknown error";
}
Expand Down
3 changes: 2 additions & 1 deletion libde265/de265.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ typedef enum {
DE265_WARNING_CANNOT_APPLY_SAO_OUT_OF_MEMORY=1024,
DE265_WARNING_SPS_MISSING_CANNOT_DECODE_SEI=1025,
DE265_WARNING_COLLOCATED_MOTION_VECTOR_OUTSIDE_IMAGE_AREA=1026,
DE265_WARNING_PCM_BITDEPTH_TOO_LARGE=1027
DE265_WARNING_PCM_BITDEPTH_TOO_LARGE=1027,
DE265_WARNING_REFERENCE_IMAGE_BIT_DEPTH_DOES_NOT_MATCH=1028
} de265_error;

LIBDE265_API const char* de265_get_error_text(de265_error err);
Expand Down
5 changes: 5 additions & 0 deletions libde265/motion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@ void generate_inter_prediction_samples(base_context* ctx,

// TODO: fill predSamplesC with black or grey
}
else if (img->get_bit_depth(0) != refPic->get_bit_depth(0) ||
img->get_bit_depth(1) != refPic->get_bit_depth(1)) {
img->integrity = INTEGRITY_DECODING_ERRORS;
ctx->add_warning(DE265_WARNING_REFERENCE_IMAGE_BIT_DEPTH_DOES_NOT_MATCH, false);
}
else {
// 8.5.3.2.2

Expand Down

0 comments on commit fbd0b3a

Please sign in to comment.