s5p-mfc: Fix the calculation of DPB size for non H264 video
authorKamil Debski <k.debski@samsung.com>
Wed, 2 Apr 2014 09:08:37 +0000 (11:08 +0200)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:59:57 +0000 (11:59 +0900)
Image size was used instead of the buffer size which resulted in a smaller
than necessary buffer allocation.

Change-Id: Ia457957cf8e2777e01c3d9f18216156b0dce4856
Signed-off-by: Kamil Debski <k.debski@samsung.com>
drivers/media/platform/s5p-mfc/s5p_mfc_opr_v5.c

index 58ec7bb..bfaad2c 100644 (file)
@@ -288,7 +288,7 @@ static void s5p_mfc_dec_calc_dpb_size_v5(struct s5p_mfc_ctx *ctx)
                ctx->luma_size = ALIGN(ctx->buf_width * ctx->buf_height,
                                S5P_FIMV_DEC_BUF_ALIGN);
                ctx->chroma_size = ALIGN(ctx->buf_width *
-                               ALIGN((ctx->img_height >> 1),
+                               ALIGN((ctx->buf_height >> 1),
                                        S5P_FIMV_NV12MT_VALIGN),
                                S5P_FIMV_DEC_BUF_ALIGN);
                ctx->mv_size = ALIGN(ctx->buf_width *
@@ -297,16 +297,16 @@ static void s5p_mfc_dec_calc_dpb_size_v5(struct s5p_mfc_ctx *ctx)
                                S5P_FIMV_DEC_BUF_ALIGN);
        } else {
                guard_width =
-                       ALIGN(ctx->img_width + 24, S5P_FIMV_NV12MT_HALIGN);
+                       ALIGN(ctx->buf_width + 24, S5P_FIMV_NV12MT_HALIGN);
                guard_height =
-                       ALIGN(ctx->img_height + 16, S5P_FIMV_NV12MT_VALIGN);
+                       ALIGN(ctx->buf_height + 16, S5P_FIMV_NV12MT_VALIGN);
                ctx->luma_size = ALIGN(guard_width * guard_height,
                                S5P_FIMV_DEC_BUF_ALIGN);
 
                guard_width =
-                       ALIGN(ctx->img_width + 16, S5P_FIMV_NV12MT_HALIGN);
+                       ALIGN(ctx->buf_width + 16, S5P_FIMV_NV12MT_HALIGN);
                guard_height =
-                       ALIGN((ctx->img_height >> 1) + 4,
+                       ALIGN((ctx->buf_height >> 1) + 4,
                                        S5P_FIMV_NV12MT_VALIGN);
                ctx->chroma_size = ALIGN(guard_width * guard_height,
                                S5P_FIMV_DEC_BUF_ALIGN);