Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2021-02-26 08:19:42 +0300
committerJames Almer <jamrial@gmail.com>2021-04-27 16:43:04 +0300
commitd947464ad41ea634ab19f8d631bfc035e4a902c1 (patch)
tree9ca8597da6dfcf71f9bebb6ae4a9bf9aae80a800 /libavcodec/imgconvert.c
parentaf581cf79d317e798482a095faae781142633f49 (diff)
avcodec: Remove deprecated AVPicture API
Deprecated in a17a7661906ba295d67afd80ac0770422e1b02b3. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/imgconvert.c')
-rw-r--r--libavcodec/imgconvert.c156
1 files changed, 1 insertions, 155 deletions
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c
index a3443d1c72..40300f836d 100644
--- a/libavcodec/imgconvert.c
+++ b/libavcodec/imgconvert.c
@@ -25,13 +25,8 @@
*/
#include "avcodec.h"
-#include "internal.h"
-#include "mathops.h"
-#include "libavutil/colorspace.h"
-#include "libavutil/common.h"
#include "libavutil/pixdesc.h"
-#include "libavutil/internal.h"
-#include "libavutil/imgutils.h"
+#include "libavutil/pixfmt.h"
#if FF_API_AVCODEC_PIX_FMT
int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
@@ -72,152 +67,3 @@ enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(const enum AVPixelFormat *p
return best;
}
-#if FF_API_AVPICTURE
-FF_DISABLE_DEPRECATION_WARNINGS
-/* return true if yuv planar */
-static inline int is_yuv_planar(const AVPixFmtDescriptor *desc)
-{
- int i;
- int planes[4] = { 0 };
-
- if ( desc->flags & AV_PIX_FMT_FLAG_RGB
- || !(desc->flags & AV_PIX_FMT_FLAG_PLANAR))
- return 0;
-
- /* set the used planes */
- for (i = 0; i < desc->nb_components; i++)
- planes[desc->comp[i].plane] = 1;
-
- /* if there is an unused plane, the format is not planar */
- for (i = 0; i < desc->nb_components; i++)
- if (!planes[i])
- return 0;
- return 1;
-}
-
-int av_picture_crop(AVPicture *dst, const AVPicture *src,
- enum AVPixelFormat pix_fmt, int top_band, int left_band)
-{
- const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
- int y_shift;
- int x_shift;
- int max_step[4];
-
- if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
- return -1;
-
- y_shift = desc->log2_chroma_h;
- x_shift = desc->log2_chroma_w;
- av_image_fill_max_pixsteps(max_step, NULL, desc);
-
- if (is_yuv_planar(desc)) {
- dst->data[0] = src->data[0] + (top_band * src->linesize[0]) + left_band;
- dst->data[1] = src->data[1] + ((top_band >> y_shift) * src->linesize[1]) + (left_band >> x_shift);
- dst->data[2] = src->data[2] + ((top_band >> y_shift) * src->linesize[2]) + (left_band >> x_shift);
- } else{
- if(top_band % (1<<y_shift) || left_band % (1<<x_shift))
- return -1;
- dst->data[0] = src->data[0] + (top_band * src->linesize[0]) + (left_band * max_step[0]);
- }
-
- dst->linesize[0] = src->linesize[0];
- dst->linesize[1] = src->linesize[1];
- dst->linesize[2] = src->linesize[2];
- return 0;
-}
-
-int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,
- enum AVPixelFormat pix_fmt, int padtop, int padbottom, int padleft, int padright,
- int *color)
-{
- const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt);
- uint8_t *optr;
- int y_shift;
- int x_shift;
- int yheight;
- int i, y;
- int max_step[4];
-
- if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
- return -1;
-
- if (!is_yuv_planar(desc)) {
- if (src)
- return -1; //TODO: Not yet implemented
-
- av_image_fill_max_pixsteps(max_step, NULL, desc);
-
- if (padtop || padleft) {
- memset(dst->data[0], color[0],
- dst->linesize[0] * padtop + (padleft * max_step[0]));
- }
-
- if (padleft || padright) {
- optr = dst->data[0] + dst->linesize[0] * padtop +
- (dst->linesize[0] - (padright * max_step[0]));
- yheight = height - 1 - (padtop + padbottom);
- for (y = 0; y < yheight; y++) {
- memset(optr, color[0], (padleft + padright) * max_step[0]);
- optr += dst->linesize[0];
- }
- }
-
- if (padbottom || padright) {
- optr = dst->data[0] + dst->linesize[0] * (height - padbottom) -
- (padright * max_step[0]);
- memset(optr, color[0], dst->linesize[0] * padbottom +
- (padright * max_step[0]));
- }
-
- return 0;
- }
-
- for (i = 0; i < 3; i++) {
- x_shift = i ? desc->log2_chroma_w : 0;
- y_shift = i ? desc->log2_chroma_h : 0;
-
- if (padtop || padleft) {
- memset(dst->data[i], color[i],
- dst->linesize[i] * (padtop >> y_shift) + (padleft >> x_shift));
- }
-
- if (padleft || padright) {
- optr = dst->data[i] + dst->linesize[i] * (padtop >> y_shift) +
- (dst->linesize[i] - (padright >> x_shift));
- yheight = (height - 1 - (padtop + padbottom)) >> y_shift;
- for (y = 0; y < yheight; y++) {
- memset(optr, color[i], (padleft + padright) >> x_shift);
- optr += dst->linesize[i];
- }
- }
-
- if (src) { /* first line */
- uint8_t *iptr = src->data[i];
- optr = dst->data[i] + dst->linesize[i] * (padtop >> y_shift) +
- (padleft >> x_shift);
- memcpy(optr, iptr, (width - padleft - padright) >> x_shift);
- iptr += src->linesize[i];
- optr = dst->data[i] + dst->linesize[i] * (padtop >> y_shift) +
- (dst->linesize[i] - (padright >> x_shift));
- yheight = (height - 1 - (padtop + padbottom)) >> y_shift;
- for (y = 0; y < yheight; y++) {
- memset(optr, color[i], (padleft + padright) >> x_shift);
- memcpy(optr + ((padleft + padright) >> x_shift), iptr,
- (width - padleft - padright) >> x_shift);
- iptr += src->linesize[i];
- optr += dst->linesize[i];
- }
- }
-
- if (padbottom || padright) {
- optr = dst->data[i] + dst->linesize[i] *
- ((height - padbottom) >> y_shift) - (padright >> x_shift);
- memset(optr, color[i],dst->linesize[i] *
- (padbottom >> y_shift) + (padright >> x_shift));
- }
- }
-
- return 0;
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif /* FF_API_AVPICTURE */