| 172 | } |
| 173 | |
| 174 | static void hw_base_encode_add_next_prev(FFHWBaseEncodeContext *ctx, |
| 175 | FFHWBaseEncodePicture *pic) |
| 176 | { |
| 177 | int i; |
| 178 | |
| 179 | if (!pic) |
| 180 | return; |
| 181 | |
| 182 | if (pic->type == FF_HW_PICTURE_TYPE_IDR) { |
| 183 | for (i = 0; i < ctx->nb_next_prev; i++) { |
| 184 | --ctx->next_prev[i]->ref_count[0]; |
| 185 | ctx->next_prev[i] = NULL; |
| 186 | } |
| 187 | ctx->next_prev[0] = pic; |
| 188 | ++pic->ref_count[0]; |
| 189 | ctx->nb_next_prev = 1; |
| 190 | |
| 191 | return; |
| 192 | } |
| 193 | |
| 194 | if (ctx->nb_next_prev < ctx->ref_l0) { |
| 195 | ctx->next_prev[ctx->nb_next_prev++] = pic; |
| 196 | ++pic->ref_count[0]; |
| 197 | } else { |
| 198 | --ctx->next_prev[0]->ref_count[0]; |
| 199 | for (i = 0; i < ctx->ref_l0 - 1; i++) |
| 200 | ctx->next_prev[i] = ctx->next_prev[i + 1]; |
| 201 | ctx->next_prev[i] = pic; |
| 202 | ++pic->ref_count[0]; |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | static int hw_base_encode_pick_next(AVCodecContext *avctx, |
| 207 | FFHWBaseEncodeContext *ctx, |
no outgoing calls
no test coverage detected