+ init_put_bits(&s->reorder_pb[i], reorder_buffer[1][i], 7*32);
+ }
+ if(s->picture.pict_type == P_TYPE){
+ const uint8_t *vlc= svq1_block_type_vlc[SVQ1_BLOCK_INTER];
+ put_bits(&s->reorder_pb[5], vlc[1], vlc[0]);
+ score[1] = vlc[1]*lambda;
+ for(i=0; i<2; i++){
+ vlc= svq1_motion_component_vlc[32];
+ put_bits(&s->reorder_pb[5], vlc[1], vlc[0]);
+ score[1] += vlc[1]*lambda;
+ }
+
+ score[1]+= encode_block(s, src+16*x, ref, decoded, stride, 5, 64, lambda, 0);
+ best= score[1] <= score[0];
+ if(best==1){
+ for(i=0; i<6; i++){
+ count[1][i]= put_bits_count(&s->reorder_pb[i]);
+ flush_put_bits(&s->reorder_pb[i]);
+ }
+ }
+ }else
+ best= 0;
+
+ s->rd_total += score[best];
+
+ for(i=5; i>=0; i--){
+ ff_copy_bits(&s->pb, reorder_buffer[best][i], count[best][i]);
+ }
+ if(best==0){
+ s->dsp.put_pixels_tab[0][0](decoded, temp, stride, 16);