return vaStatus;
}
+ render_state->inited = 1;
+
switch (obj_config->profile) {
case VAProfileH264Baseline:
case VAProfileH264Main:
image->height = obj_surface->orig_height;
image->data_size = data_size;
- if (render_state->interleaved_uv) {
- image->format.fourcc = VA_FOURCC('N','V','1','2');
- image->format.byte_order = VA_LSB_FIRST;
- image->format.bits_per_pixel = 12;
- image->num_planes = 2;
- image->pitches[0] = w_pitch;
- image->offsets[0] = 0;
- image->pitches[1] = w_pitch;
- image->offsets[1] = w_pitch * h_pitch;
+ if (!render_state->inited) {
+ image->format.fourcc = VA_FOURCC('Y','V','1','2');
+ image->format.byte_order = VA_LSB_FIRST;
+ image->format.bits_per_pixel = 12;
+ image->num_planes = 3;
+ image->pitches[0] = w_pitch;
+ image->offsets[0] = 0;
+ image->pitches[1] = w_pitch / 2;
+ image->offsets[1] = w_pitch * h_pitch;
+ image->pitches[2] = w_pitch / 2;
+ image->offsets[2] = w_pitch * h_pitch + (w_pitch / 2) * (h_pitch / 2);
} else {
- image->format.fourcc = VA_FOURCC('Y','V','1','2');
- image->format.byte_order = VA_LSB_FIRST;
- image->format.bits_per_pixel = 12;
- image->num_planes = 3;
- image->pitches[0] = w_pitch;
- image->offsets[0] = 0;
- image->pitches[1] = w_pitch / 2;
- image->offsets[1] = w_pitch * h_pitch;
- image->pitches[2] = w_pitch / 2;
- image->offsets[2] = w_pitch * h_pitch + (w_pitch / 2) * (h_pitch / 2);
+ if (render_state->interleaved_uv) {
+ image->format.fourcc = VA_FOURCC('N','V','1','2');
+ image->format.byte_order = VA_LSB_FIRST;
+ image->format.bits_per_pixel = 12;
+ image->num_planes = 2;
+ image->pitches[0] = w_pitch;
+ image->offsets[0] = 0;
+ image->pitches[1] = w_pitch;
+ image->offsets[1] = w_pitch * h_pitch;
+ } else {
+ image->format.fourcc = VA_FOURCC('I','4','2','0');
+ image->format.byte_order = VA_LSB_FIRST;
+ image->format.bits_per_pixel = 12;
+ image->num_planes = 3;
+ image->pitches[0] = w_pitch;
+ image->offsets[0] = 0;
+ image->pitches[1] = w_pitch / 2;
+ image->offsets[1] = w_pitch * h_pitch;
+ image->pitches[2] = w_pitch / 2;
+ image->offsets[2] = w_pitch * h_pitch + (w_pitch / 2) * (h_pitch / 2);
+ }
}
if (obj_surface->bo == NULL) {
i965_render_src_surface_state(ctx, 1, region, 0, rw, rh, w, I965_SURFACEFORMAT_R8_UNORM); /* Y */
i965_render_src_surface_state(ctx, 2, region, 0, rw, rh, w, I965_SURFACEFORMAT_R8_UNORM);
- if (render_state->interleaved_uv) {
- i965_render_src_surface_state(ctx, 3, region, w * h, rw / 2, rh / 2, w, I965_SURFACEFORMAT_R8G8_UNORM); /* UV */
- i965_render_src_surface_state(ctx, 4, region, w * h, rw / 2, rh / 2, w, I965_SURFACEFORMAT_R8G8_UNORM);
- } else {
- int u3 = 3, u4 = 4, v5 = 5, v6 = 6;
+ if (!render_state->inited) {
+ int u3 = 5, u4 = 6, v5 = 3, v6 = 4;
- if (obj_surface->flags & SURFACE_DERIVED) {
- u3 = 5, u4 = 6, v5 = 3, v6 = 4;
- }
-
i965_render_src_surface_state(ctx, u3, region, w * h, rw / 2, rh / 2, w / 2, I965_SURFACEFORMAT_R8_UNORM); /* U */
i965_render_src_surface_state(ctx, u4, region, w * h, rw / 2, rh / 2, w / 2, I965_SURFACEFORMAT_R8_UNORM);
i965_render_src_surface_state(ctx, v5, region, w * h + w * h / 4, rw / 2, rh / 2, w / 2, I965_SURFACEFORMAT_R8_UNORM); /* V */
i965_render_src_surface_state(ctx, v6, region, w * h + w * h / 4, rw / 2, rh / 2, w / 2, I965_SURFACEFORMAT_R8_UNORM);
+ } else {
+ if (render_state->interleaved_uv) {
+ i965_render_src_surface_state(ctx, 3, region, w * h, rw / 2, rh / 2, w, I965_SURFACEFORMAT_R8G8_UNORM); /* UV */
+ i965_render_src_surface_state(ctx, 4, region, w * h, rw / 2, rh / 2, w, I965_SURFACEFORMAT_R8G8_UNORM);
+ } else {
+ int u3 = 3, u4 = 4, v5 = 5, v6 = 6;
+
+ i965_render_src_surface_state(ctx, u3, region, w * h, rw / 2, rh / 2, w / 2, I965_SURFACEFORMAT_R8_UNORM); /* U */
+ i965_render_src_surface_state(ctx, u4, region, w * h, rw / 2, rh / 2, w / 2, I965_SURFACEFORMAT_R8_UNORM);
+ i965_render_src_surface_state(ctx, v5, region, w * h + w * h / 4, rw / 2, rh / 2, w / 2, I965_SURFACEFORMAT_R8_UNORM); /* V */
+ i965_render_src_surface_state(ctx, v6, region, w * h + w * h / 4, rw / 2, rh / 2, w / 2, I965_SURFACEFORMAT_R8_UNORM);
+ }
}
}