Message ID | 20240529214632.9843-1-jamrial@gmail.com |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,1/6] avcodec/packet: add a decoded frame cropping side data type | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
On 29/05/2024 23:46, James Almer wrote: > Signed-off-by: James Almer <jamrial@gmail.com> > --- > libavcodec/packet.h | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/libavcodec/packet.h b/libavcodec/packet.h > index a9a41576da..9dee035690 100644 > --- a/libavcodec/packet.h > +++ b/libavcodec/packet.h > @@ -330,6 +330,20 @@ enum AVPacketSideDataType { > */ > AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT, > > + /** > + * The number of pixels to discard from the > + * top/bottom/left/right border of the decoded frame to obtain the sub-rectangle > + * intended for presentation. > + * > + * @code > + * u32le crop_top > + * u32le crop_bottom > + * u32le crop_left > + * u32le crop_right > + * @endcode > + */ > + AV_PKT_DATA_FRAME_CROPPING, > + > /** > * The number of side data types. > * This is not part of the public API/ABI in the sense that it may Shouldn't this be propagated to the frame's crop fields, and back from the crop fields to the packet side-data?
On 5/29/2024 10:02 PM, Lynne via ffmpeg-devel wrote: > On 29/05/2024 23:46, James Almer wrote: >> Signed-off-by: James Almer <jamrial@gmail.com> >> --- >> libavcodec/packet.h | 14 ++++++++++++++ >> 1 file changed, 14 insertions(+) >> >> diff --git a/libavcodec/packet.h b/libavcodec/packet.h >> index a9a41576da..9dee035690 100644 >> --- a/libavcodec/packet.h >> +++ b/libavcodec/packet.h >> @@ -330,6 +330,20 @@ enum AVPacketSideDataType { >> */ >> AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT, >> + /** >> + * The number of pixels to discard from the >> + * top/bottom/left/right border of the decoded frame to obtain >> the sub-rectangle >> + * intended for presentation. >> + * >> + * @code >> + * u32le crop_top >> + * u32le crop_bottom >> + * u32le crop_left >> + * u32le crop_right >> + * @endcode >> + */ >> + AV_PKT_DATA_FRAME_CROPPING, >> + >> /** >> * The number of side data types. >> * This is not part of the public API/ABI in the sense that it may > > Shouldn't this be propagated to the frame's crop fields, and back from > the crop fields to the packet side-data? We no longer use frames and packets to communicate global side data, and we can't use frame cropping values as global metadata for the container's header because there's codec level cropping too (like h264 to remove padding coded at certain dimensions) in them.
James Almer: > Signed-off-by: James Almer <jamrial@gmail.com> > --- > libavcodec/packet.h | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/libavcodec/packet.h b/libavcodec/packet.h > index a9a41576da..9dee035690 100644 > --- a/libavcodec/packet.h > +++ b/libavcodec/packet.h > @@ -330,6 +330,20 @@ enum AVPacketSideDataType { > */ > AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT, > > + /** > + * The number of pixels to discard from the > + * top/bottom/left/right border of the decoded frame to obtain the sub-rectangle > + * intended for presentation. > + * > + * @code > + * u32le crop_top > + * u32le crop_bottom > + * u32le crop_left > + * u32le crop_right > + * @endcode > + */ > + AV_PKT_DATA_FRAME_CROPPING, > + > /** > * The number of side data types. > * This is not part of the public API/ABI in the sense that it may As I already said about an earlier iteration of this: The cropping is a rational in ISOBMFF, so it should be here, too. - Andreas
On 6/25/2024 3:13 PM, Andreas Rheinhardt wrote: > James Almer: >> Signed-off-by: James Almer <jamrial@gmail.com> >> --- >> libavcodec/packet.h | 14 ++++++++++++++ >> 1 file changed, 14 insertions(+) >> >> diff --git a/libavcodec/packet.h b/libavcodec/packet.h >> index a9a41576da..9dee035690 100644 >> --- a/libavcodec/packet.h >> +++ b/libavcodec/packet.h >> @@ -330,6 +330,20 @@ enum AVPacketSideDataType { >> */ >> AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT, >> >> + /** >> + * The number of pixels to discard from the >> + * top/bottom/left/right border of the decoded frame to obtain the sub-rectangle >> + * intended for presentation. >> + * >> + * @code >> + * u32le crop_top >> + * u32le crop_bottom >> + * u32le crop_left >> + * u32le crop_right >> + * @endcode >> + */ >> + AV_PKT_DATA_FRAME_CROPPING, >> + >> /** >> * The number of side data types. >> * This is not part of the public API/ABI in the sense that it may > > As I already said about an earlier iteration of this: The cropping is a > rational in ISOBMFF, so it should be here, too. No, i don't want it being a rational. It even makes no sense being one in ISOBMFF to begin with. I don't consider it worth making things any more complex.
diff --git a/libavcodec/packet.h b/libavcodec/packet.h index a9a41576da..9dee035690 100644 --- a/libavcodec/packet.h +++ b/libavcodec/packet.h @@ -330,6 +330,20 @@ enum AVPacketSideDataType { */ AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT, + /** + * The number of pixels to discard from the + * top/bottom/left/right border of the decoded frame to obtain the sub-rectangle + * intended for presentation. + * + * @code + * u32le crop_top + * u32le crop_bottom + * u32le crop_left + * u32le crop_right + * @endcode + */ + AV_PKT_DATA_FRAME_CROPPING, + /** * The number of side data types. * This is not part of the public API/ABI in the sense that it may
Signed-off-by: James Almer <jamrial@gmail.com> --- libavcodec/packet.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+)