Ticket #787: commflag-svn_format-aspect.patch

File commflag-svn_format-aspect.patch, 4.6 KB (added by paulx@…, 18 years ago)

format aspect patch

  • programs/mythcommflag/ClassicCommDetector.cpp

    .diff -Nur mythtv-svn/programs/mythcommflag/ClassicCommDetector.cpp mythtv-svn-fix/programs/mythcommflag/ClassicCommDetector.cpp
    old new  
    11341134    }
    11351135    else
    11361136    {
    1137         for (int i=0;i<COMM_FORMAT_MAX;i++) formatCounts[i]=0;
     1137        memset(&formatCounts, 0, sizeof(formatCounts));
    11381138
    11391139        for(long long i = 0; i < framesProcessed; i++ )
    11401140            formatCounts[frameInfo[i].format]++;
     
    13101310                }
    13111311            }
    13121312
     1313            if ((!decoderFoundAspectChanges) && (fbp->formatMatch < (fbp->frames * .10)))
     1314            {
     1315                if (verboseDebugging)
     1316                    VERBOSE(VB_COMMFLAG, "      < 10% of frames match show "
     1317                            "letter/pillar-box format, -20");
     1318                fbp->score -= 20;
     1319            }
     1320
    13131321            if ((abs((int)(fbp->frames - (15 * fps))) < 5 ) ||
    13141322                (abs((int)(fbp->frames - (30 * fps))) < 6 ) ||
    13151323                (abs((int)(fbp->frames - (60 * fps))) < 8 ))
     
    13341342                            " == 0, -10");
    13351343                fbp->score -= 10;
    13361344            }
     1345
     1346            if ((!decoderFoundAspectChanges) && (fbp->formatMatch < (fbp->frames * .10)))
     1347            {
     1348                if (verboseDebugging)
     1349                    VERBOSE(VB_COMMFLAG, "      < 10% of frames match show "
     1350                            "letter/pillar-box format, -10");
     1351                fbp->score -= 10;
     1352            }
    13371353
    13381354            if (fbp->ratingCount > (fbp->frames * 0.25))
    13391355            {
     
    13441360            }
    13451361        }
    13461362
    1347         if (decoderFoundAspectChanges)
    1348         {
    1349             if (fbp->aspectMatch > (fbp->frames * .90))
    1350             {
    1351                 if (verboseDebugging)
    1352                     VERBOSE(VB_COMMFLAG, "      > 90% of frames match show "
    1353                             "aspect, +10");
    1354                 fbp->score += 10;
    1355 
    1356                 if (fbp->aspectMatch > (fbp->frames * .95))
    1357                 {
    1358                     if (verboseDebugging)
    1359                         VERBOSE(VB_COMMFLAG, "      > 95% of frames match show "
    1360                                 "aspect, +10");
    1361                     fbp->score += 10;
    1362                 }
    1363             }
    1364             else if (fbp->aspectMatch < (fbp->frames * .10))
    1365             {
    1366                 if (verboseDebugging)
    1367                     VERBOSE(VB_COMMFLAG, "      < 10% of frames match show "
    1368                             "aspect, -10");
    1369                 fbp->score -= 10;
    1370 
    1371                 if (fbp->aspectMatch < (fbp->frames * .05))
    1372                 {
    1373                     if (verboseDebugging)
    1374                         VERBOSE(VB_COMMFLAG, "      < 5% of frames match show "
    1375                                 "aspect, -10");
    1376                     fbp->score -= 10;
    1377                 }
    1378             }
    1379         }
    1380         else if (format != COMM_FORMAT_NORMAL)
     1363        if (decoderFoundAspectChanges && (fbp->aspectMatch < (fbp->frames * .10)))
    13811364        {
    1382             if (fbp->formatMatch > (fbp->frames * .90))
    1383             {
    1384                 if (verboseDebugging)
    1385                     VERBOSE(VB_COMMFLAG, "      > 90% of frames match show "
    1386                             "letter/pillar-box format, +10");
    1387                 fbp->score += 10;
    1388 
    1389                 if (fbp->formatMatch > (fbp->frames * .95))
    1390                 {
    1391                     if (verboseDebugging)
    1392                         VERBOSE(VB_COMMFLAG, "      > 95% of frames match show "
    1393                                 "letter/pillar-box format, +10");
    1394                     fbp->score += 10;
    1395                 }
    1396             }
    1397             else if (fbp->formatMatch < (fbp->frames * .10))
    1398             {
    1399                 if (verboseDebugging)
    1400                     VERBOSE(VB_COMMFLAG, "      < 10% of frames match show "
    1401                             "letter/pillar-box format, -10");
    1402                 fbp->score -= 10;
    1403 
    1404                 if (fbp->formatMatch < (fbp->frames * .05))
    1405                 {
    1406                     if (verboseDebugging)
    1407                         VERBOSE(VB_COMMFLAG, "      < 5% of frames match show "
    1408                                 "letter/pillar-box format, -10");
    1409                     fbp->score -= 10;
    1410                 }
    1411             }
     1365            if (verboseDebugging)
     1366                VERBOSE(VB_COMMFLAG, "      < 10% of frames match show "
     1367                        "aspect, -20");
     1368            fbp->score -= 20;
    14121369        }
    14131370
    14141371        msg.sprintf("  NOW %3d:%02d %6ld %6ld %6ld %7.2f %3d %6d %6d %6d "