diff --git a/src/hal/hisi/v1_hal.c b/src/hal/hisi/v1_hal.c index 2005109..420f8f8 100644 --- a/src/hal/hisi/v1_hal.c +++ b/src/hal/hisi/v1_hal.c @@ -515,7 +515,7 @@ int v1_video_create(char index, hal_vidconfig *config) attrib->profile = MIN(config->profile, 1); attrib->byFrame = 0; attrib->fieldOn = 0; - attrib->mainStrmOn = index ? 0 : 1; + attrib->mainStrmOn = 1; attrib->priority = 0; attrib->fieldOrFrame = 0; attrib->pic.width = config->width; diff --git a/src/hal/hisi/v1_vb.h b/src/hal/hisi/v1_vb.h index 26118c8..1da7a76 100644 --- a/src/hal/hisi/v1_vb.h +++ b/src/hal/hisi/v1_vb.h @@ -50,5 +50,11 @@ inline static unsigned int v1_buffer_calculate_venc(short width, short height, v unsigned int bufSize = CEILING_2_POWER(width, alignWidth) * CEILING_2_POWER(height, alignWidth) * (pixFmt == V1_PIXFMT_YUV422SP ? 2 : 1.5); - return bufSize; + unsigned int headSize = 16 * height; + if (pixFmt == V1_PIXFMT_YUV422SP) + headSize *= 2; + else if (pixFmt == V1_PIXFMT_YUV420SP) + headSize *= 3; + headSize >>= 1; + return bufSize + headSize; } \ No newline at end of file