Skip to contentSkip to conversation

media: coda: Fix definition of CODA_STD_MJPG

PATCH In review Martin Kepplinger 2 participants 2 messages Nov 8, 2017 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: coda: Fix definition of CODA_STD_MJPG

According to i.MX 6 VPU API Reference Manual Rev. L3.0.35_1.1.0, 01/2013 chapter 3.2.1.5, the MJPG video codec is refernced to by number 7, not 3. So change this accordingly.

This isn't yet being used right now and therefore probably hasn't been noticed. Fixing this avoids causing trouble in the future.

---
 drivers/media/platform/coda/coda_regs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/coda/coda_regs.h +1 -1
index 38df5fd9a2fa..8d726faaf86e 100644
@@ -254,7 +254,7 @@
 #define		CODA9_STD_H264					0
 #define		CODA_STD_H263					1
 #define		CODA_STD_H264					2
-#define		CODA_STD_MJPG					3
+#define		CODA_STD_MJPG					7
 #define		CODA9_STD_MPEG4					3
 
 #define CODA_CMD_ENC_SEQ_SRC_SIZE				0x190
Signature · 1 line
2.11.0
#1 lore raw

Hi Martin,

thank you for the patch. I'd prefer to just drop CODA_STD_MJPG altogether, to avoid confusion. Explanation below:

Quoted 17 lines · Martin Kepplinger

According to i.MX 6 VPU API Reference Manual Rev. L3.0.35_1.1.0, 01/2013 chapter 3.2.1.5, the MJPG video codec is refernced to by number 7, not 3. So change this accordingly.

This isn't yet being used right now and therefore probably hasn't been noticed. Fixing this avoids causing trouble in the future.

---
 drivers/media/platform/coda/coda_regs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/coda/coda_regs.h +0 -0
index 38df5fd9a2fa..8d726faaf86e 100644

drivers/media/platform/coda/coda_regs.h line 257

Quoted 5 lines
drivers/media/platform/coda/coda_regs.h +1 -1
@@ -254,7 +254,7 @@
 #define		CODA9_STD_H264					0
 #define		CODA_STD_H263					1
 #define		CODA_STD_H264					2
-#define		CODA_STD_MJPG					3
+#define		CODA_STD_MJPG					7

These are only ever used to feed them into the CMD_ENC_SEQ_COD_STD register, and only for MPEG4, H263 (which we don't support), and H264.

On i.MX53 the correct value was 3 once, but it was only used in the userspace library, it was never written to any register. On i.MX6 JPEG encoding can be implemented without going through the BIT processor at all.

regards
Philipp