Changeset 909 in SHVCSoftware


Ignore:
Timestamp:
17 Oct 2014, 16:58:14 (10 years ago)
Author:
nokia
Message:

Update BLRewrite tool (JCTVC-R0042).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/App/utils/BLRewrite/BLRewrite.c

    r778 r909  
    197197  FILE *outFile;
    198198  int assignedBaseLayerId;
     199  int tIdTarget = 6;
    199200  NalUnitHeader nalu;
    200201  int numStartCodeZeros;
    201   int isSpsPpsEosEob;
    202 
    203   if (argc < 3)
    204   {
    205     printf("Usage: Splicer <infile> <outfile> <assigned base layer ID>\n", argv[0]);
     202  int nalIsSpsPpsEob;
     203  int removeNal;
     204
     205  if (argc < 4 || argc > 5)
     206  {
     207    fprintf(stderr, "Usage: BLRewrite <infile> <outfile> <assigned base layer ID> [<max temporal ID>]\n");
     208    exit(1);
    206209  }
    207210
     
    221224
    222225  assignedBaseLayerId = atoi(argv[3]);
     226  if (assignedBaseLayerId < 1 || assignedBaseLayerId > 7)
     227  {
     228    fprintf(stderr, "Invalid assigned base layer ID (must be in range 1-7)\n");
     229    exit(1);
     230  }
     231
     232  if (argc == 5)
     233  {
     234    tIdTarget = atoi(argv[4]);
     235    if (tIdTarget < 0 || tIdTarget > 6)
     236    {
     237      fprintf(stderr, "Invalid maximum temporal ID (must be in range 0-6)\n");
     238      exit(1);
     239    }
     240  }
    223241
    224242  while (1)
     
    235253    printf("NAL unit type: %i,  NUH layer ID: %i,  NUH Temporal ID: %i\n", nalu.nalUnitType, nalu.nuhLayerId, nalu.nuhTemporalIdPlus1 - 1);
    236254
    237     isSpsPpsEosEob = (nalu.nalUnitType == NAL_UNIT_SPS || nalu.nalUnitType == NAL_UNIT_PPS || nalu.nalUnitType == NAL_UNIT_EOS || nalu.nalUnitType == NAL_UNIT_EOB);
    238 
    239     if ((isSpsPpsEosEob && nalu.nuhLayerId == 0) || (!isSpsPpsEosEob && nalu.nuhLayerId == assignedBaseLayerId))
     255    nalIsSpsPpsEob = (nalu.nalUnitType == NAL_UNIT_SPS || nalu.nalUnitType == NAL_UNIT_PPS || nalu.nalUnitType == NAL_UNIT_EOB);
     256
     257    removeNal = (!nalIsSpsPpsEob && (nalu.nuhLayerId != assignedBaseLayerId))
     258             || (nalIsSpsPpsEob && (nalu.nuhLayerId != 0) && (nalu.nuhLayerId != assignedBaseLayerId))
     259             || (nalu.nalUnitType == NAL_UNIT_VPS)
     260             || ((nalu.nuhTemporalIdPlus1 - 1) > tIdTarget);
     261
     262    if (!removeNal)
    240263    {
    241264      /* Write current NAL unit to output bitstream */
Note: See TracChangeset for help on using the changeset viewer.