[FFmpeg-devel] [PATCH] MXF - Add jpeg2000 subdescriptor - Sponsored by INA

Tomas Härdin git at haerdin.se
Thu Apr 27 15:45:46 EEST 2023


>  static inline uint16_t rescale_mastering_chroma(AVRational q)
>  {
> @@ -1260,7 +1305,6 @@ static int64_t
> mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID
>          f1 *= 2;
>      }
>  
> -

Stray deleted line

> +    /* Image components number */
> +    mxf_write_local_tag(s, 2, 0x840A);
> +    avio_wb16(pb, component_count);
> +   /* Array of picture components where each component comprises 3

Looks like you missed a space there (:

> +    /* Extract usefull size infromation from the SIZ marker */
> +    if (bytestream2_get_be16u(&g) != JPEG2000_SIZ) {
> +        av_log(s, AV_LOG_ERROR, "SIZ marker not present\n");
> +        return 0;
> +    }
> +    bytestream2_skip(&g, 2); // Skip Lsiz
> +    sc->j2k_cap = bytestream2_get_be16u(&g);
> +    sc->j2k_xsiz = bytestream2_get_be32u(&g);
> +    sc->j2k_ysiz = bytestream2_get_be32u(&g);
> +    sc->j2k_x0siz = bytestream2_get_be32u(&g);
> +    sc->j2k_y0siz = bytestream2_get_be32u(&g);
> +    sc->j2k_xtsiz = bytestream2_get_be32u(&g);
> +    sc->j2k_ytsiz = bytestream2_get_be32u(&g);
> +    sc->j2k_xt0siz = bytestream2_get_be32u(&g);
> +    sc->j2k_yt0siz = bytestream2_get_be32u(&g);
> +    j2k_ncomponents = bytestream2_get_be16u(&g);
> +    if (j2k_ncomponents != component_count) {
> +        av_log(s, AV_LOG_WARNING, "Incoherence about components
> image number.\n");

Erroring out here seems more appropriate.

/Tomas




More information about the ffmpeg-devel mailing list