| 1108 | */ |
| 1109 | |
| 1110 | static int dca_decode_block(DCAContext * s) |
| 1111 | { |
| 1112 | |
| 1113 | /* Sanity check */ |
| 1114 | if (s->current_subframe >= s->subframes) { |
| 1115 | av_log(s->avctx, AV_LOG_DEBUG, "check failed: %i>%i", |
| 1116 | s->current_subframe, s->subframes); |
| 1117 | return -1; |
| 1118 | } |
| 1119 | |
| 1120 | if (!s->current_subsubframe) { |
| 1121 | #ifdef TRACE |
| 1122 | av_log(s->avctx, AV_LOG_DEBUG, "DSYNC dca_subframe_header\n"); |
| 1123 | #endif |
| 1124 | /* Read subframe header */ |
| 1125 | if (dca_subframe_header(s)) |
| 1126 | return -1; |
| 1127 | } |
| 1128 | |
| 1129 | /* Read subsubframe */ |
| 1130 | #ifdef TRACE |
| 1131 | av_log(s->avctx, AV_LOG_DEBUG, "DSYNC dca_subsubframe\n"); |
| 1132 | #endif |
| 1133 | if (dca_subsubframe(s)) |
| 1134 | return -1; |
| 1135 | |
| 1136 | /* Update state */ |
| 1137 | s->current_subsubframe++; |
| 1138 | if (s->current_subsubframe >= s->subsubframes) { |
| 1139 | s->current_subsubframe = 0; |
| 1140 | s->current_subframe++; |
| 1141 | } |
| 1142 | if (s->current_subframe >= s->subframes) { |
| 1143 | #ifdef TRACE |
| 1144 | av_log(s->avctx, AV_LOG_DEBUG, "DSYNC dca_subframe_footer\n"); |
| 1145 | #endif |
| 1146 | /* Read subframe footer */ |
| 1147 | if (dca_subframe_footer(s)) |
| 1148 | return -1; |
| 1149 | } |
| 1150 | |
| 1151 | return 0; |
| 1152 | } |
| 1153 | |
| 1154 | /** |
| 1155 | * Convert bitstream to one representation based on sync marker |
no test coverage detected