Skip to content

Commit ace677e

Browse files
committed
mpeg: fix cppcheck warnings
1 parent 7b27778 commit ace677e

File tree

2 files changed

+25
-22
lines changed

2 files changed

+25
-22
lines changed

ee/mpeg/src/libmpeg.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ void MPEG_Destroy(void)
117117
static void *_init_seq(void)
118118
{
119119
int lMBWidth, lMBHeight;
120-
unsigned int lAllocSize;
121120
char *pA;
122121

123122
if (!s_MPEG12Ctx.m_fMPEG2) {
@@ -134,6 +133,7 @@ static void *_init_seq(void)
134133
}
135134

136135
if (lMBWidth != s_MPEG12Ctx.m_MBWidth || lMBHeight != s_MPEG12Ctx.m_MBHeight) {
136+
unsigned int lAllocSize;
137137
int i, lSize;
138138

139139
if (s_MPEG12Ctx.m_pFwdFrame)
@@ -607,7 +607,6 @@ static void _mpeg12_picture_data(void)
607607
{
608608
int lMBAMax = s_MPEG12Ctx.m_MBWidth * s_MPEG12Ctx.m_MBHeight;
609609
_MPEGMacroBlock8 *lpMB;
610-
s64 lPTS;
611610

612611
if (s_MPEG12Ctx.m_PictStruct == _MPEG_PS_FRAME && s_MPEG12Ctx.m_fSecField)
613612
s_MPEG12Ctx.m_fSecField = 0;
@@ -616,6 +615,8 @@ static void _mpeg12_picture_data(void)
616615
s_MPEG12Ctx.m_pCurFrame = s_MPEG12Ctx.m_pAuxFrame;
617616
s_MPEG12Ctx.m_AuxPTS = *s_pCurPTS;
618617
} else {
618+
s64 lPTS;
619+
619620
if (!s_MPEG12Ctx.m_fSecField) {
620621
lpMB = s_MPEG12Ctx.m_pFwdFrame;
621622
lPTS = s_MPEG12Ctx.m_FwdPTS;

ee/mpeg/src/libmpeg_core.c

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -658,31 +658,33 @@ void _MPEG_dma_ref_image(_MPEGMacroBlock8 *mb, _MPEGMotion *motions, s64 n_motio
658658
qword_t *q;
659659
int i;
660660

661-
if (n_motions > 0) {
662-
while (*R_EE_D9_CHCR & 0x100)
663-
;
664-
665-
*R_EE_D9_QWC = 0;
666-
*R_EE_D9_SADR = (u32)mb & 0xFFFFFFF;
667-
*R_EE_D9_TADR = (u32)s_DMAPack;
661+
if (n_motions <= 0) {
662+
return;
663+
}
668664

669-
q = UNCACHED_SEG(s_DMAPack);
670-
for (i = 0; i < n_motions; i++) {
671-
DMATAG_REF(q, 0x30, (u32)motions[i].m_pSrc, 0, 0, 0);
672-
q++;
673-
DMATAG_REF(q, 0x30, (u32)motions[i].m_pSrc + mbwidth, 0, 0, 0);
674-
q++;
665+
while (*R_EE_D9_CHCR & 0x100)
666+
;
675667

676-
motions[i].m_pSrc = (unsigned char *)mb;
677-
mb += 4;
678-
}
668+
*R_EE_D9_QWC = 0;
669+
*R_EE_D9_SADR = (u32)mb & 0xFFFFFFF;
670+
*R_EE_D9_TADR = (u32)s_DMAPack;
679671

680-
DMATAG_REFE(q, 0, 0, 0, 0, 0);
681-
motions[i].MC_Luma = NULL;
672+
q = UNCACHED_SEG(s_DMAPack);
673+
for (i = 0; i < n_motions; i++) {
674+
DMATAG_REF(q, 0x30, (u32)motions[i].m_pSrc, 0, 0, 0);
675+
q++;
676+
DMATAG_REF(q, 0x30, (u32)motions[i].m_pSrc + mbwidth, 0, 0, 0);
677+
q++;
682678

683-
EE_SYNCL();
684-
*R_EE_D9_CHCR = 0x105;
679+
motions[i].m_pSrc = (unsigned char *)mb;
680+
mb += 4;
685681
}
682+
683+
DMATAG_REFE(q, 0, 0, 0, 0, 0);
684+
motions[i].MC_Luma = NULL;
685+
686+
EE_SYNCL();
687+
*R_EE_D9_CHCR = 0x105;
686688
}
687689

688690
/*

0 commit comments

Comments
 (0)